Amir Amir - 5 months ago 16
PHP Question

What's the difference between "app" and "backend" in yii

what's the difference between these two lines of codes? do they refer to a same place?

use app\models\EntryForm;
use backend\models\EntryForm;

I'm using the advanced yii2

and in the yii tutorial it just uses
and I think that's because it's talking about the basic yii version. but as I said what are the differences? should I only use
while using the advanced version and
is not allowed?


the names app or backend or frontend are names of an application ..

if you are using advanced template .. you should refer to the related application using for backend

use backend\models\EntryForm; 

and the namespace definition you should use eg:

namespace backend\models\;  

or for frontend

use frontend\models\EntryForm; 

namespace frontend\models\;  

for common part you can use


   use common\models\EntryForm;

The structure is related to the