I am trying to find out if the user is guest using Yii :: app () -> user-> isGuest, but I get the following notification:
Undefined property: CWebApplication::$user
Apparently the user of the component is not yet defined in the application, I would like to know the reason.
I tried to check if the component is accessible through
if(isset(Yii::app()->user))
However, this fails. How to check if a user is a guest even if the user Yii :: app () → is not defined? ¿Should I get this notification when using isGuest?
EDIT : I changed the error_reporting directive to "E_ALL" and "E_NOTICE" and "E_DEPRECATED" and "E_STRICT" I needed to move forward. Now I got this fatal error:
Fatal error: call getId () member function for non-object in home / mario / projects / ciudad_wiki / yii / framework / web / auth / CWebUser.php on line 530
Temporary memory function
- 0.0005 235120 {main} () ../ index.php: 0
- 0.0207 1548168 CApplication-> run () ../ index.php: 13
- 0.0207 1548352 CWebApplication-> processRequest () ../ CApplication.php: 162
- 0.0235 1725768 CWebApplication-> runController () ../ CWebApplication.php: 135
- 0.0272 2103464 CController-> run () ../ CWebApplication.php: 276
- 0.0279 2145872 CController-> runActionWithFilters () ../ CController.php: 266
- 0.0279 2145984 CController-> runAction () ../ CController.php: 287
- 0.0279 2146128 CInlineAction-> runWithParams () ../ CController.php: 309
- 0.0279 2146688 SiteController-> actionIndex () ../ CInlineAction.php: 50
- 0.0529 3875888 CController- > render()../SiteController.php: 33
- 0.0529 3876112 CController- > renderPartial()../CController.php: 783
- 0.0532 3877352 CBaseController- > renderFile()../CController.php: 870
- 0.0532 3877672 CBaseController- > renderInternal()../CBaseController.php: 96
- 0.0539 3918144 require (foo_dir/protected/views/site/index.php)../CBaseController.php: 127
- 0.0705 4428584 CModule → __ get()../CBaseController.php: 199
- 0.0705 4428584 CModule- > getComponent()../CModule.php: 104
- 0.0723 4580360 CWebUser- > init()../CModule.php: 388
- 0.0736 4671144 CWebUser- > getIsGuest()../CWebUser.php: 195
- 0.0736 4671240 CWebUser- > getState()../CWebUser.php: 279
- 0.0736 4671320 CWebUser- > getStateKeyPrefix()../CWebUser.php: 557
, Yii - $_SESSION, .
EDIT # 2: E_NOTICE, :
PHP
EDIT # 3: php 5.4. php 5.3, , , , , php 5.4. bool.dev, .