0

Yii::app()->getModule('user') 在 vi​​ew/layouts/main.php 中没有返回正确的值

我正在使用 Yii-User YII-User Extension 来管理用户相关的功能。当我 Yii::app()->getModule('user')->loginUrl,

我明白了

试图获取非对象的属性

array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("登录"), '可见'=>Yii::app()->user->isGuest),

请告诉我出了什么问题,是已知问题还是类似问题。

这是 config/main.php

// autoloading model and component classes
'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',

),
   'modules' => array(

         'user'=>array(

                # enable debuging 
                'debug' => true,

                # encrypting method (php hash function)
                'hash' => 'md5',

                # send activation email
                'sendActivationMail' => true,

                # allow access for non-activated users
                'loginNotActiv' => false,

                # activate user on registration (only sendActivationMail = false)
                'activeAfterRegister' => false,

                # automatically login from registration
                'autoLogin' => true,

                # registration path
                'registrationUrl' => array('/user/registration'),

                # recovery password path
                'recoveryUrl' => array('/user/recovery'),

                # login form path
                'loginUrl' => array('/user/login'),

                # page after login
                'returnUrl' => array('/user/profile'),

                # page after logout
                'returnLogoutUrl' => array('/user/login'),

                # Adding Table refrences 
                'tableUsers' => 'tbl_users',
                'tableProfiles' => 'tbl_profiles',
                'tableProfileFields' => 'tbl_profiles_fields',
                ),
        ),
4

0 回答 0