Модель (лишние строки убраны):
Код: Выделить всё
class ApprovalForm extends Model
{
public $note_approver;
public function rules()
{
return [
['note_approver', 'testValue'],
['note_approver', 'file']
];
}
public function testValue($attribute, $param)
{
$this->addError($attribute, 'Тест провален');
}
}