Wednesday, August 10, 2011

Use session instead of stateful forms

Here's why:


  1. If you decide to use AJAX later on (in particular I mean to HIJAX your forms), you'll have to set and get the YII_PAGE_STATE variable for every action, which is a pain in the ass. 
  2. page state is broken when you try to use partial rendering. Even if the partially rendered form is a complete CActiveForm, YII_PAGE_STATE will end up blank. 
I am referring to pages that post back to themselves and that have related sub-items for which you need to maintain state. 

No comments:

Post a Comment