Pascool
(Pgermain2)
February 28, 2011, 8:09pm
1
Hi, I’m just trying to use a textarea in a model’s form, which is not required and not searchable. So it’s not mentionnend in any of the model’s rules and its value is never saved or updated. How to make this work? I tried with ‘allowEmpty’ in many ways, but never found how/where to write it. Or maybe I have to use a ‘length’ validator. Thanks for your help, it seems so simple…
tri
(tri - Tommy Riboe)
February 28, 2011, 8:15pm
2
Pascool:
Hi, I’m just trying to use a textarea in a model’s form, which is not required and not searchable. So it’s not mentionnend in any of the model’s rules and its value is never saved or updated. How to make this work? I tried with ‘allowEmpty’ in many ways, but never found how/where to write it. Or maybe I have to use a ‘length’ validator. Thanks for your help, it seems so simple…
Read this subsection of The Definitive Guide to Yii. Hint: safe validator .
Edit: mdomba added a better link.
/Tommy
Pascool
(Pgermain2)
February 28, 2011, 8:24pm
3
Thanks for the quicks answers
mdomba’s post disappeard, but I could find the link the mail I received:
And the answer is…
array('content', 'safe'),
… Thanks again!
mdomba
(Maurizio Domba Cerin)
February 28, 2011, 8:31pm
4
I posted at the same time as tri… but a milliseconds later… so I just deleted the post at it looked to me that they where identical
Pascool
(Pgermain2)
February 28, 2011, 8:33pm
5
Yeah that’s what I thought
But I mentionned your link as tri said it was better (I know, that’s what you thought )