Question, studying the documentation for Yii is not quite figured out with the validation of incoming data:
class InsertForm extends Model {
public $author; public $message; public function rules() { return [ ['author', 'validateValue'], ['message', 'validateValue'], ]; } /** * @param $attribute * @param $params */ public function validateValue($attribute, $params) { if ((strlen($attribute)<=5)) { $this->addError($attribute, 'ΠΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½Π°Ρ Π΄Π»ΠΈΠ½Π½Π° ΠΏΠΎΠ»Ρ 5 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²'); } } }
Those. the length of incoming values ββmust start from 5 characters