m.. m.. - 1 year ago 49
PHP Question

Need explanation on how Yii::app()->name works

Hello guys I was confused to what Yii::app()->name meant. I know that Yii::app() is calling the static function app() in the YiiBase class, but there is no property name in that same class, can someone explain.

Answer Source

In CApplication there is a public property named 'name'


name property public string $name; the application name. Defaults to 'My Application'.

this mean that


simply refer to the name public attribute

in index.php you have


In Yii YiibBase class the

{return}    CWebApplication 

and CWebApplication http://www.yiiframework.com/doc/api/1.1/CWebApplication

extend CApplication ..

Inheritance class CWebApplication » CApplication » CModule » CComponent