I'm trying to develope a simple crud with yii2 and I have problems because when I try to show a view I have a 404 Error
I have this structure
And I'm trying to show the person view so I do this: http://localhost:83/yii2-proyecto/backend/web/index.php?r=personal/person and I have the 404 mistake but if I do http://localhost:83/yii2-proyecto/backend/web/index.php?r=personal everything works fine because the default view is showed.
In my config/main.php I have this piece of code:
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [
'personal' => [
'class' => 'backend\modules\Personal\Module',
],
],
On PersonalController I have this for index
public function actionIndex()
{
$searchModel = new PersonSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
And I have imported this:
namespace backend\modules\personal\controllers;
use Yii;
use common\models\Person;
use backend\modules\Personal\models\PersonSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\User;
use yii\web\UploadedFile;
So I don't know why I have a 404 when I try to show the person view. Any idea?. Thanks a million