In the backend/config/main file, there is a reference to the module class:
'modules' => [
'cropk' => [
'class' => 'app\modules\cropk\CropK',
]
],
In the vendor/xxx/cropk directory, there is the following class CropK:
namespace app\modules\cropk;
class CropK extends \yii\base\Module {
public function init() {
parent::init();
}
}
The vendor/xxx/cropk/controllers/DefaultController:
namespace app\modules\cropk\controllers;
use yii\web\Controller;
class DefaultController extends Controller {
public function actionIndex() {
return $this->render('index');
}
}
But when I access the URL http://admin.cropk.dev/cropk, I get this error:
Class app\modules\cropk\CropK does not exist
Can't I put the module outside of the backend directory? How can I do that?
Normaly the module is indicated in this way
and rename your module class in
Module
and notCropk
This is a sample of Module.php