开发者

extension question,YiiFramework

开发者 https://www.devze.com 2023-01-23 00:27 出处:网络
I use the mod开发者_开发技巧ule user http://yiiframework.com/extension/yii-user/ then open localhost/testdrive and get an error - trying to get property of non-object

I use the mod开发者_开发技巧ule user http://yiiframework.com/extension/yii-user/ then open localhost/testdrive and get an error - trying to get property of non-object on line - array('url'=>Yii::app()->getModule('user')->loginUrl, did everything according to instructions from the link


Maybe you should add 'class' parameter to 'user' to configuration in main.php, ie:

'components'=>array(
      'user' => array(
            'class' => 'application.components.WebUser',
            'allowAutoLogin' => true,
            'loginUrl' => array('/ua/user/login'),
      )...


I figured out why this was happening to me, too. I had put the block at the end of main.php. If you put it at the beginning, the problem goes away.

0

精彩评论

暂无评论...
验证码 换一张
取 消