Yii Framework Forum: How To Override Config Value From Controller - Yii Framework Forum

Jump to content

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

How To Override Config Value From Controller Trying to override language value in sitecontroller Rate Topic: -----

#1 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 370
  • Joined: 08-October 12
  • Location:Austria

Posted 14 October 2012 - 01:38 AM

Hi,

I am getting following error, when i am trying to assign value inside controller like this

Fatal error: Call to undefined function app() in C:\xampp\htdocs\CMS\protected\controllers\SiteController.php

inside sitecontroller :: actionLogin() method first line

Yii:app()->language = 'in';


Anyhelp will be appreciated..
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#2 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 668
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 14 October 2012 - 02:06 AM

change your
Yii:app()->language = 'in';


as following

Yii::app()->language = 'in';

1

#3 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 370
  • Joined: 08-October 12
  • Location:Austria

Posted 14 October 2012 - 03:27 AM

View Postalirz23, on 14 October 2012 - 02:06 AM, said:

change your
Yii:app()->language = 'in';


as following

Yii::app()->language = 'in';




Thanks for your quick response.

I could not able to find any difference in both code. Anyway i solved my problem placing the line inside beforeAction method.

Thanks for your valuable time
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
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