{"id":4968,"date":"2021-08-09T07:46:11","date_gmt":"2021-08-09T07:46:11","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=4968"},"modified":"2021-08-09T07:46:11","modified_gmt":"2021-08-09T07:46:11","slug":"yii-validacziya","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/yii-validacziya\/","title":{"rendered":"Yii \u2014 \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.&nbsp;\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>yii \\ base \\ Model :: validate ()<\/strong>&nbsp;.&nbsp;\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e.&nbsp;\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430&nbsp;<strong>yii \\ base \\ Model :: $ errors<\/strong>&nbsp;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e&nbsp;<strong>validate ()<\/strong>&nbsp;\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>yii \\ base \\ Model :: rules ()<\/strong>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 1<\/strong>&nbsp;\u2014 \u041c\u0435\u0442\u043e\u0434&nbsp;<strong>rules ()<\/strong>&nbsp;\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[\n   \/\/ required, specifies which attributes should be validated\n   ['attr1', 'attr2', ...],\n   \/\/ required, specifies the type a rule.\n   'type_of_rule',\n   \/\/ optional, defines in which scenario(s) this rule should be applied\n   'on' =&gt; ['scenario1', 'scenario2', ...],\n   \/\/ optional, defines additional configurations\n   'property' =&gt; 'value', ...\n]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043a \u043a\u0430\u043a\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438 \u0442\u0438\u043f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:&nbsp;<strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435, \u043a\u0430\u043f\u0447\u0430, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u0434\u0430\u0442\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0434\u0432\u0430\u0436\u0434\u044b, \u043a\u0430\u0436\u0434\u044b\u0439, \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0447\u0442\u0430, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0444\u0430\u0439\u043b, \u0444\u0438\u043b\u044c\u0442\u0440, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, ip, in, \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u0447\u0438\u0441\u043b\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439, \u0441\u0442\u0440\u043e\u043a\u0430, \u043e\u0431\u0440\u0435\u0437\u043a\u0430, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439, URL<\/strong>&nbsp;\u2014&nbsp;<strong>\u0430\u0434\u0440\u0435\u0441.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 2<\/strong>&nbsp;\u2014 \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043f\u0430\u043f\u043a\u0435&nbsp;<strong>\u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/strong>&nbsp;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n   namespace app\\models;\n   use Yii;\n   use yii\\base\\Model;\n   class RegistrationForm extends Model {\n      public $username;\n      public $password;\n      public $email;\n      public $country;\n      public $city;\n      public $phone;\n      public function rules() {\n         return [\n            \/\/ the username, password, email, country, city, and phone attributes are\n            \/\/required\n            [['username' ,'password', 'email', 'country', 'city', 'phone'], 'required'],\n            \/\/ the email attribute should be a valid email address\n            ['email', 'email'],\n         ];\n      }\n   }\n?&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b.&nbsp;\u041c\u043e\u0434\u0435\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u043f\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u2014 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0430\u0440\u043e\u043b\u044c, \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b, \u0441\u0442\u0440\u0430\u043d\u0430, \u0433\u043e\u0440\u043e\u0434 \u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d.&nbsp;\u0412\u0441\u0435 \u043e\u043d\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u0430 \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 3<\/strong>&nbsp;\u2014 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>actionRegistration<\/strong>&nbsp;\u0432&nbsp;<strong>SiteController,<\/strong>&nbsp;\u0433\u0434\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c&nbsp;<strong>RegistrationForm<\/strong>&nbsp;\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">public function actionRegistration() {\n   $model = new RegistrationForm();\n   return $this-&gt;render('registration', ['model' =&gt; $model]);\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 4<\/strong>&nbsp;\u2014 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b.&nbsp;\u0412\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 views \/ site \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b registration.php \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n   use yii\\bootstrap\\ActiveForm;\n   use yii\\bootstrap\\Html;\n?&gt;\n\n&lt;div class = \"row\"&gt;\n   &lt;div class = \"col-lg-5\"&gt;\n      &lt;?php $form = ActiveForm::begin(['id' =&gt; 'registration-form']); ?&gt;\n         &lt;?= $form-&gt;field($model, 'username') ?&gt;\n         &lt;?= $form-&gt;field($model, 'password')-&gt;passwordInput() ?&gt;\n         &lt;?= $form-&gt;field($model, 'email')-&gt;input('email') ?&gt;\n         &lt;?= $form-&gt;field($model, 'country') ?&gt;\n         &lt;?= $form-&gt;field($model, 'city') ?&gt;\n         &lt;?= $form-&gt;field($model, 'phone') ?&gt;\n         &lt;div class = \"form-group\"&gt;\n            &lt;?= Html::submitButton('Submit', ['class' =&gt; 'btn btn-primary',\n               'name' =&gt; 'registration-button']) ?&gt;\n         &lt;\/div&gt;\n      &lt;?php ActiveForm::end(); ?&gt;\n   &lt;\/div&gt;\n&lt;\/div&gt;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u00a0<strong>ActiveForm<\/strong>\u00a0\u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 5<\/strong>&nbsp;\u2014 \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0439\u0434\u0435\u0442\u0435 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442&nbsp;<strong>http: \/\/ localhost: 8080 \/ index.php? R = site \/ registration<\/strong>&nbsp;\u0438 \u043d\u0430\u0436\u043c\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/coderlessons.com\/wp-content\/uploads\/2019\/07\/validation_rules.png\" alt=\"\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 6.<\/strong>&nbsp;\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430&nbsp;<strong>username<\/strong>&nbsp;, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>rules ()<\/strong>&nbsp;\u043e\u0431\u044a\u0435\u043a\u0442\u0430&nbsp;<strong>RegistrationForm<\/strong>&nbsp;\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">public function rules() {\n   return [\n      \/\/ the username, password, email, country, city, and phone attributes are required\n      [['password', 'email', 'country', 'city', 'phone'], 'required'],\n      <strong>['username', 'required', 'message' =&gt; 'Username is required'],<\/strong>\n      \/\/ the email attribute should be a valid email address\n      ['email', 'email'],\n   ];\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 7.<\/strong>&nbsp;\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442&nbsp;<strong>http: \/\/ localhost: 8080 \/ index.php? R = site \/ registration<\/strong>&nbsp;\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438.&nbsp;\u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 username \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/coderlessons.com\/wp-content\/uploads\/2019\/07\/change_username_property.png\" alt=\"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 8<\/strong>&nbsp;\u2014 \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>yii \\ base \\ Model :: beforeValidate (): \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u043e\u0431\u044b\u0442\u0438\u0435 yii \\ base \\ Model :: EVENT_BEFORE_VALIDATE.<\/li><li>yii \\ base \\ Model :: afterValidate (): \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u043e\u0431\u044b\u0442\u0438\u0435 yii \\ base \\ Model :: EVENT_AFTER_VALIDATE.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">yii \\ base \\ Model :: beforeValidate (): \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0441\u043e\u0431\u044b\u0442\u0438\u0435 yii \\ base \\ Model :: EVENT_BEFORE_VALIDATE.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">yii \\ base \\ Model :: afterValidate (): \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0441\u043e\u0431\u044b\u0442\u0438\u0435 yii \\ base \\ Model :: EVENT_AFTER_VALIDATE.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 9<\/strong>&nbsp;\u2014 \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u0430\u043d\u044b \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u0432\u0432\u043e\u0434 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u043e\u0440\u043e\u0434\u0430 \u0432 \u043d\u043e\u043b\u044c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435&nbsp;<strong>\u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c<\/strong>&nbsp;\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u043f\u043e&nbsp;<strong>\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong>&nbsp;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">public function rules() {\n   return [\n      \/\/ the username, password, email, country, city, and phone attributes are required\n      [['password', 'email', 'country', 'city', 'phone'], 'required'],\n      ['username', 'required', 'message' =&gt; 'Username is required'],\n      <strong>['country', 'trim'],\n      ['city', 'default'],<\/strong>\n      \/\/ the email attribute should be a valid email address\n      ['email', 'email'],\n   ];\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0428\u0430\u0433 10<\/strong>&nbsp;\u2014 \u0415\u0441\u043b\u0438 \u0432\u0445\u043e\u0434 \u043f\u0443\u0441\u0442, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">public function rules() {\n   return [\n      ['city', 'default', 'value' =&gt; 'Paris'],\n   ];\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e city \u043f\u0443\u0441\u0442\u043e, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u00abParis\u00bb.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.&nbsp;\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;yii \\ base [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[156],"tags":[],"class_list":["post-4968","page","type-page","status-publish","hentry","category-yii"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/4968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=4968"}],"version-history":[{"count":1,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/4968\/revisions"}],"predecessor-version":[{"id":4969,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/4968\/revisions\/4969"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=4968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=4968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=4968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}