skos
skos

Reputation: 4222

Getting Undefined Property Notice Even Though Its Defined

I just started on YII today and have an existing project to work on. When I am trying to run the project, I am getting a following Notice -

Notice: Undefined property: CWebApplication::$v_glob in ..\controllers\SiteController.php on line 10

When I check SiteController class I do see that v_glob is indeed defined. This is how the class looks -

class SiteController extends Controller
{ 
    public function init()
    {
          Yii::app()->v_glob;
          parent::init();
    } 

   /* other functions */
} 

Due to this notice I am getting fatal errors wherever I am trying to call its member functions. How can I resolve this?

Upvotes: 0

Views: 197

Answers (1)

soju
soju

Reputation: 25322

Well, take a look carefully at the notice :

Undefined property: CWebApplication::$v_glob

The attribute v_glob has to be defined in CWebApplication, not in your SiteController...

PS : And the following line is not really useful:

Yii::app()->v_glob;

Upvotes: 1

Related Questions