Hello. Connected to the project extension yii-user. Lies in the modules / user folder.
Everything seems to work.
The extension has a WebUser class from CWebUser. I added my isAdmin () method.
As part of the extension, I use it like this: Yii :: app () -> user-> isAdmin (), and when I want to call in the main application, I get "Error 500. In the CWebUser class and its behaviors, no method or closure with named "isAdmin". "
It turns out that in the main application it is not connected.
In config / main.php:

'import'=>array( 'application.models.*', 'application.components.*', 'application.modules.user.models.*', 'application.modules.user.components.*', ), 

How to connect it so that you can use extension classes in the main application?

    1 answer 1

    It turns out I forgot to add to the config:

      // application components 'components'=>array( #... 'user'=>array( // enable cookie-based authentication 'class' => 'WebUser', 'allowAutoLogin'=>true, 'loginUrl' => array('/user/login'), ), #... ),