These are predefined aliases for your app paths - which come predefined with your basic or advanced app. For example @app, @frontend, @common, @backend. You may want to read about these and use them. You need to use them in your namespaces. Else you may create your own path alias using Yii::setAlias.
You may want to read this FIRST if you are coming over from Yii 1.x to Yii 2.
Thanks you were right, I added app\ and it worked.
But there is something I really find strange in Yii 2, it takes a longtime to type these urls, why there is not an automatic system that calculate them in ajax for us or something similar?
I feel like Gii regressed from Yii 1, no? It was much easier to create a CRUD before.
I have a similar problem as well. (Qualifier - I am new to using Yii and Gii)
I have yii2 advanced installed. I can create a model just fine using Gii, but when I run the CRUD Generator I consistently get this error:
Class ‘backend\models\Dealers’ does not exist or has syntax error.
Here is what I have in the Model Generator:
Table Name
dealers
[b]
Model Class[/b]
Dealers
[b]
Namespace[/b]
backend\models\Dealers
The model generates successfully and pulls the database table fields into the code as expected:
namespace backend\models\Dealers;
use Yii;
/**
This is the model class for table "dealers".
@property integer $d_id
@property string $d_name
@property string $d_type
@property string $d_url
@property string $d_address
@property string $d_address2
@property string $d_city
@property string $d_state
@property integer $d_zip
@property string $d_country
@property string $d_phone
@property string $d_contact
Then I move on to the CRUD Generator with the following:
[b]
Model Class[/b]
backend\models\Dealers
Search Model Class
backend\models\DealersSearch
Controller Class
backend\controllers\DealersController
[b]
View Path[/b]
@backend/views/dealers
When I click preview, I get the error no matter how I change the names and paths (Class ‘backend\models\Dealers’ does not exist or has syntax error.)
I checked the file structure and there is indeed a file located at backend/models/Dealers/Dealers.php. I’m not sure where to go from here, It seems like I have done everything correctly. Hoping I can get past this error and get to know Yii better as I would like to build an upcoming project using it.