Yii Framework Forum: CWebApplication.xxxxx not defined - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CWebApplication.xxxxx not defined Setting an APP level variable Rate Topic: -----

#1 User is offline   gil blais 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-January 10

Posted 09 January 2010 - 10:49 AM

In my .protected/config/main.php I have the following:
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
// Yii::app()->name gets this...
'name'=>'Blais Family Ancestry WEB site',

/********** This is the line causing my exception **************/
'longname' => 'Blais Family Ancestry WEB site - private to specific Blais families',
/***************************************************************/

'preload'=>array('log'), // preloading 'log' component
....
....
....

and I get the following CException message:
Property "CWebApplication.longname" is not defined.
Source File
F:\Apps\Xampp_172\xampp\htdocs\YII\framework\base\CModule.php(435)

I cannot discover why this is. Any help is well appreciated.
Thanks in advance, Gil Blais
0

#2 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 09 January 2010 - 11:05 AM

You can't set "longname" because it's not an attribute of CWebApplication. If you want to store custom stuff, you can use the params array in your config. Example:

...
'params' => array(
   'longname' => 'example',
),
...


In your application you can access the params array like:

echo Yii::app()->params['longname'];

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users