javedboqo
(Javi Hunzai)
February 8, 2012, 6:31am
1
Hi buddies!
I am new to YII framework. I have just followed the basic concept of creating database and using GII to create model classes. After creating model classes I have changed my database table e.g. inserted new field and now how can get its effect in model classes(views etc)?
scspl.pravin
(Phpwebdeveloper900)
February 8, 2012, 6:47am
2
hi
you have add your new field on
public function rules()
{
any methods
}
public function attributeLabels()
{
add here
}
than effect on view
Thanks
javedboqo
(Javi Hunzai)
February 8, 2012, 7:09am
3
thanks for reply
well i have made changes as you have tell me on last post, but i can get this field(depEndDate) in view.
public function rules()
{
return array(
array('depName', 'required'),
array('depName', 'length', 'max'=>20),
array('depEndDate', 'length', 'max'=>5),//newly added field in table
array('depId, depName', 'safe', 'on'=>'search'),
);
}
public function attributeLabels()
{
return array(
'depId' => 'Dep',
'depName' => 'Dep Name',
'depEndDate'=>'End Date'//newly added field in table
);
}
jacmoe
(Jacob Moen)
February 8, 2012, 4:18pm
4
[color="#006400 "]/* moved from Yii 1.0 to Yii 1.1 general help forum */[/color]