Yii Framework For Dummies …

Hi everyone

Did you ever made a mistake that led you to question your mentality while learning Yii Framework? Which we can call Stupid mistakes …

I did, many times … may be publishing these mistakes help some of you avoiding time consuming or at least let them know that they are not the only stupid members, if there is really who makes stupid mistakes like me (I hope that).

Mistake (1):

I learned that I should make those attributes (non model attrib (non table fields)) in a safeAttribute function and I’m sure I did, but it didn’t work.

After tow days I discovered that I put the safeAttribute function in the controller and not the model. (why the hell yiic tool doesn’t generates the safeAttribute function? This is my excuse).

Mistake (2):

I tried for many times to retrieve the $model values from the _form which I’m sure I passed from the controller without any results.

Later I remembered that I’m passing the $model to the create view not to the form so I should pass it again from the create to the _form through partial.

why should it be (double views ) in the first place.

To be continued …

Hi,

for your information, note that in verion 1.1, CModel::safeAttributes is removed !

thanks for your post, I’m sure it will be useful to Yii newcomers ;)

8)

Thank you Raoul

safeAttributes was confusing actually because i need to redeclare my model attributes as a safe attributes also not only the (non model attrib) … this wasn’t expected in a framework using (Yii Tool) … and i think the new development eleminate retyping …

thank you for that Raoul