SoCal
(Sasha81 Ca)
1
Hi I’m trying to do a few calculations on the attributes of the model after the properties have been chunk assigned (safe).
$model->attributes = $_POST['MyModel'];
I'd like to have something like:
public function afterSet(){
... my code
}
I’m purposefully don’t want to use beforeSave().
oligalma
(Marc Oliveras)
2
Maybe you could use a filter in your rules() method
http://www.yiiframework.com/wiki/56/#hh13
SiZE
(Sizemail)
3
It executes only on validate();
So you need to create your method and call after set. Or ovverride setAttributes method and add afterSetAttributes callback.
SoCal
(Sasha81 Ca)
4
@SiZE
I really like your idea. Thanks! 