database - View with small modifications for different types of article -


i have 1 view type of article, need extends view , if user open article type "special" need show new fields in view.

i don't want create separate view type of form because differs 1 field.

also need save in database, in field "type" 1 different value if "special" article saved.

please suggest me how can this.

well, should use if statement in view display, or not, additional fields, , use beforesave method in model handle type attribute.

protected function beforesave() {     // if ('special' article)     //     $this->type = 'value';     parent::beforesave(); } 

you should consider using scenario.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -