Problems inserting in Yii framework
I assign a value to the model's property in the controller:
Such as:
$model =new Post;
$model->type=1;
In my view, the visual
Beginwidget (' Cactiveform ', Array (
' id ' = ' china4a-reg-form ',
' Enableajaxvalidation ' =>false,
));
This way to get the values of the other fields.
The method of submission is:
Isnewrecord? ' Submit ': ' Save ');?>
But the value inside the widget can be inserted into the database correctly, but the $model->type is not plugged in.
The study of the half-day did not try to come out, how can I also insert this field record? Also please master can point pointing.
------Solution--------------------
Your $model is outside (probably still touching the inside of the method) you don't pass the words, how does he know?
------Solution--------------------
Yes. Your $model->type need to be submitted with other content
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.