How to use the Yii namespace

I got confused about understanding the namespace from the Yii documentation, as there are not enough examples to understand, since I am new to the Yii framework, please give some simple and detailed examples so that I can understand this goal.

+7
source share
1 answer

You can try reading this documentation http://yiiframework.ru/doc/guide/en/basics.namespace In general, Yii namespaces are aliases for folders. I.E.

'aliases' => array( 'frontend' => dirname(__FILE__) . '/../..' . '/frontend', 'common' => dirname(__FILE__) . '/../..' . '/common', 'backend' => dirname(__FILE__) . '/../..' . '/backend', 'vendor' => dirname(__FILE__) . '/../..' . '/common/lib/vendor' ), ... 'import' => array( 'common.extensions.components.*', 'common.components.*', 'common.helpers.*', 'common.models.*', 'application.controllers.*', // In result "common" = dirname(__FILE__) . '/../..' . '/common' 
+2
source

All Articles