我的控制器中有以下代码,基本上是尝试使用通过作曲家安装的this库
use Symfony\Component\HttpFoundation\Response;
require __DIR__.'/../../vendor/autoload.php';
class MainController
{
public function number()
{
$username = 'someusername';
$password = 'somepassword';
$debug = true;
$truncatedDebug = false;
$ig = new \InstagramAPI\Instagram($debug,$truncatedDebug);
$number = random_int(0,100);
return new Response(
'<html><body>Lucky number: '.$number.'</body></html>'
);
}
}
但是它给了我以下
Attempted to load class "Instagram" from namespace "InstagramAPI".
Did you forget a "use" statement for another namespace?
我尝试添加使用命名空间Instagram,但没有成功