[英]lumen.ERROR: ReflectionException: Class App\Http\Controllers\App\Http\Controllers\CategoriesController does not exist
I Create Restapi for my Joomla Site using lumen. 我使用流明为Joomla网站创建Restapi。 I got Following Error in Lumen Route File.
我在流明路径文件中出现“跟随错误”。
lumen.ERROR: ReflectionException: Class App\Http\Controllers\App\Http\Controllers\CategoriesController does not exist in /var/www/j2mobapp/plugins/system/j2mobrest/api/vendor/illuminate/container/Container.php:749
My Route File Code : 我的路线文件代码:
$app->group(['prefix' => 'api/v2','namespace' => 'App\Http\Controllers'], function($app)
{
$app->get('appbanners/{id}', 'CategoriesController@getBannerImag');
});
What about deleting this from the group: 从群组中删除该怎么办:
'namespace' => 'App\Http\Controllers'
As it is a default. 由于它是默认设置。 That's why you see it doubled.
这就是为什么您看到它翻倍的原因。
So unless you put them in a custom folder in your Controller
folder, for example Admin
then you will need to add 'namespace' => 'Admin'
so each controller in the group will be prefixed as App\\Http\\Controllers\\Admin
因此,除非将它们放在
Controller
文件夹中的自定义文件夹中,例如Admin
否则您将需要添加'namespace' => 'Admin'
以便组中的每个控制器都将以App\\Http\\Controllers\\Admin
为前缀
Also make sure that in your CategoriesController
you have the namespace correct at the top of the class which is: 还要确保在
CategoriesController
您在类顶部具有正确的名称空间是:
namespace App\Http\Controllers;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.