0

Yii::app()->getModule('user') is not returning the right value in view/layouts/main.php

I am using Yii-User YII-User Extension to manage the User related features. When I Yii::app()->getModule('user')->loginUrl,

I get

Trying to get property of non-object

at

array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("Login"), 'visible'=>Yii::app()->user->isGuest),

Pls tell me whats going wrong, is it a known issue or something like that.

Here is the 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',
                ),
        ),
bool.dev
  • 17,508
  • 5
  • 69
  • 93
indianwebdevil
  • 4,879
  • 7
  • 37
  • 51

0 Answers0