Yii Framework Forum: getPageState not working as anticipated - Yii Framework Forum

Jump to content

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

getPageState not working as anticipated Yii 1.1.10 Rate Topic: -----

#1 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 698
  • Joined: 02-February 09

Posted 05 May 2012 - 06:09 PM

I am using set/getPageState to transfer data between requests. What I have is actionIndex in which I define the state such as
$this->setPageState('type', $model['type']);


Then I have another actionNext in which I change the type with the exact same code above.

Once my form is rendered through actionIndex it is then submitted via ajax to actionNext without going though actionIndex again.

if I attempt to print
$this->getPageState('type');
in the index view I have no problems but if I print it in the actionNext nothing prints out so I am wondering why the getPageState works in the view but not in the controller/action level.

Any ideas?

Cheers,
bettor
0

#2 User is offline   twisted1919 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 517
  • Joined: 23-October 10
  • Location:Romania

Posted 05 May 2012 - 07:19 PM

Why not use Yii::app()->user->setFlash() / Yii::app()->user->getFlash() ?
0

#3 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 698
  • Joined: 02-February 09

Posted 06 May 2012 - 12:27 AM

View Posttwisted1919, on 05 May 2012 - 07:19 PM, said:

Why not use Yii::app()->user->setFlash() / Yii::app()->user->getFlash() ?


Thanks for your reply twisted1919. The reason I don't want to use set/getFlash is because I want it to be session independent.
0

#4 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 698
  • Joined: 02-February 09

Posted 06 May 2012 - 01:01 AM

I guess this isn't really working with ajax bur rather only with POST requests
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