Problems with inserting in YII framework

Source: Internet
Author: User
Problems inserting in Yii framework
I assign a value to the model's property in the controller:
Such as:
$model =new Post;

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.

Your $model is outside (probably still touching the inside of the method) you don't pass the words, how does he know?
Yes. Your $model->type need to be submitted with other content
  • Contact Us

    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: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.