Hi,
I have written my new CFormModel by copying and modifying existing CActiveRecord model.
I've changed everything I need, but in rules() I did not change (remove) 'on'=>'search' param from safe validator.
This caused my attributes to not being bind after form submitted. After I removed this parameter everything started to work fine.
Is this a normal situation?
Regards,
Trejder
Page 1 of 1
CFormModel attributes not binded after POST
#1
Posted 14 December 2011 - 10:23 AM
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
#2
Posted 17 February 2013 - 01:13 AM
Trejder, on 14 December 2011 - 10:23 AM, said:
Hi,
I have written my new CFormModel by copying and modifying existing CActiveRecord model.
I've changed everything I need, but in rules() I did not change (remove) 'on'=>'search' param from safe validator.
This caused my attributes to not being bind after form submitted. After I removed this parameter everything started to work fine.
Is this a normal situation?
Regards,
Trejder
I have written my new CFormModel by copying and modifying existing CActiveRecord model.
I've changed everything I need, but in rules() I did not change (remove) 'on'=>'search' param from safe validator.
This caused my attributes to not being bind after form submitted. After I removed this parameter everything started to work fine.
Is this a normal situation?
Regards,
Trejder
i have the same situation in my application. did you have any other solution other than rewriting the CformModel ?
all my attributes are assigned to safe buy yet $model->attributes mass assignment does not hold any values.
any help is highly appreciated.
#3
Posted 17 February 2013 - 03:50 AM
Hi all.
I think the line:
('attibute','safe','on'=>'search')
only works when you do a search.
Then,you could add this line in rules and test:
('attribute','safe')
Are you sure all data is send by post? You can show Firebug notice.
Regards.
I think the line:
('attibute','safe','on'=>'search')
only works when you do a search.
Then,you could add this line in rules and test:
('attribute','safe')
Are you sure all data is send by post? You can show Firebug notice.
Regards.
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
Share this topic:
Page 1 of 1