Answer the question
In order to leave comments, you need to log in
How to properly add custom form validation in yii2?
Learning the very basics of the framework tutorial https://github.com/yiisoft/yii2/blob/master/docs/g... there is a form validation model
namespace app\models;
use yii\base\Model;
class EntryForm extends Model
{
public $name;
public $email;
public function rules()
{
return [
[['name', 'email'], 'required'],
['email', 'email'],
];
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question