Well,
We may use the filter validators in models this way:
This is working well presuming 'someFunction' is defined within the model class. But how to use a 'shared' library of filter functions - e.g. function stored in a helper file?
Any ideas? - Thanks ahead!
We may use the filter validators in models this way:
public function rules() { return array ( array('myAttribute', 'filter', 'filter' => array($this, 'someFunction')), } } public function someFunction($attribute) { return 'Ho ho ho ' . $attribute; }
This is working well presuming 'someFunction' is defined within the model class. But how to use a 'shared' library of filter functions - e.g. function stored in a helper file?
Any ideas? - Thanks ahead!