diff --git a/config/test.php b/config/test.php index a23616e..7f4ef36 100644 --- a/config/test.php +++ b/config/test.php @@ -22,7 +22,7 @@ ], 'request' => [ 'cookieValidationKey' => 'test', - 'enableCsrfValidation' => false, + 'enableCsrfValidation' => true, // but if you absolutely need it set cookie domain to localhost /* 'csrfCookie' => [ diff --git a/config/web.php b/config/web.php index 4d645cf..eca0f47 100644 --- a/config/web.php +++ b/config/web.php @@ -38,14 +38,12 @@ ], ], 'db' => require(__DIR__ . '/db.php'), - /* 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ], ], - */ ], 'params' => $params, ]; diff --git a/controllers/AppController.php b/controllers/AppController.php new file mode 100644 index 0000000..de51731 --- /dev/null +++ b/controllers/AppController.php @@ -0,0 +1,10 @@ +render('index', [ + 'model' => $model, + ]); + } + + /** + * @return string + */ + public function actionBoolean() + { + $model = new BooleanForm(); + + return $this->render('boolean', [ + 'model' => $model, + ]); + } + + /** + * @return string + */ + public function actionCaptcha() + { + $model = new Captcha(); + + return $this->render('captcha', [ + 'model' => $model + ]); + + } + + /** + * @return string + */ + public function actionOthers() + { + $model = new OthersForm; + + return $this->render('others', [ + 'model' => $model + ]); + } +} \ No newline at end of file diff --git a/models/BooleanForm.php b/models/BooleanForm.php new file mode 100644 index 0000000..872a7b2 --- /dev/null +++ b/models/BooleanForm.php @@ -0,0 +1,21 @@ + true, 'falseValue' => false, 'strict' => true], + + ]; + } +} \ No newline at end of file diff --git a/models/Captcha.php b/models/Captcha.php new file mode 100644 index 0000000..885a204 --- /dev/null +++ b/models/Captcha.php @@ -0,0 +1,17 @@ + 30, 'operator' => '>='], + [['event_date'], 'required'], + [['event_date'], 'date', 'format' => 'php:Y-m-d'], + ['default', 'default', 'value' => null], + ['salary', 'double'], + ['integerCount', 'integer', 'min' => 0, 'max' => 5], + ['email', 'email'], + ['primaryImage', 'file', 'extensions' => ['png', 'jpg', 'gif'], 'maxSize' => 1024*1024], + ]; + } +} \ No newline at end of file diff --git a/models/TextForm.php b/models/TextForm.php new file mode 100644 index 0000000..3b58d31 --- /dev/null +++ b/models/TextForm.php @@ -0,0 +1,23 @@ + [4, 24]], + ]; + } +} \ No newline at end of file diff --git a/views/validator/boolean.php b/views/validator/boolean.php new file mode 100644 index 0000000..86e8325 --- /dev/null +++ b/views/validator/boolean.php @@ -0,0 +1,16 @@ + + +