Yii: Add New Field/Coloumn Table after Generate Its Model

Maybe it’s hard to you to update your class model of a table when you’ve just add a new field/coloumn/attribute. It causes no effect on Create and Update application.

For example, you add coloumn post_code on your user table.
Then you should update the model (model/User.php):
– on function rules() just add new line: array(‘post_code’, ‘numerical’, ‘integerOnly’=>true),

– on function attributeLabels() add new line, to define its name: ‘post_code’ => ‘Post Code’,

– maybe you should update some related views file

Hope this will helping you

Categories: IT | Tags: , , | 1 Comment

Post navigation

One thought on “Yii: Add New Field/Coloumn Table after Generate Its Model

  1. Johne367

    I do trust all of the ideas you’ve presented in your post. They’re very convincing and can certainly work. Nonetheless, the posts are very short for beginners. May just you please lengthen them a bit from next time? Thanks for the post. eedkbecffegf

Tinggalkan Jejakmu berupa komen

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: