Commit ae5e6d6a99b52715b019ca718a78803e5cb41c0c
1 parent
94be54ab
admin add
Showing
2 changed files
with
12 additions
and
8 deletions
Show diff stats
backend/controllers/ParserController.php
| ... | ... | @@ -15,6 +15,12 @@ use app\components\parsers\ParserHandler; |
| 15 | 15 | */ |
| 16 | 16 | class ParserController extends Controller |
| 17 | 17 | { |
| 18 | + | |
| 19 | + public function beforeAction($action) { | |
| 20 | + $this->enableCsrfValidation = false; | |
| 21 | + return parent::beforeAction($action); | |
| 22 | + } | |
| 23 | + | |
| 18 | 24 | /** |
| 19 | 25 | * @inheritdoc |
| 20 | 26 | */ |
| ... | ... | @@ -54,11 +60,10 @@ class ParserController extends Controller |
| 54 | 60 | |
| 55 | 61 | public function actionIndex() |
| 56 | 62 | { |
| 57 | - Yii::$app->controller->enableCsrfValidation = false; | |
| 58 | 63 | $model = new UploadFileParsingForm(); |
| 59 | 64 | |
| 60 | 65 | if (Yii::$app->request->isPost) { |
| 61 | - | |
| 66 | + die('here'); | |
| 62 | 67 | $model->file = UploadedFile::getInstance($model, 'file'); |
| 63 | 68 | |
| 64 | 69 | if ($model->file && $model->validate()) { | ... | ... |
backend/views/layouts/main.php
| ... | ... | @@ -14,13 +14,12 @@ use yii\widgets\Menu; |
| 14 | 14 | AppAsset::register($this); |
| 15 | 15 | ?> |
| 16 | 16 | <?php $this->beginPage() ?> |
| 17 | -<!DOCTYPE html> | |
| 18 | -<html> | |
| 17 | +<!DOCTYPE html><html lang="<?= Yii::$app->language ?>"> | |
| 19 | 18 | <head> |
| 20 | - <meta charset="UTF-8"> | |
| 21 | - <title>AdminLTE 2 | Dashboard</title> | |
| 22 | - <!-- Tell the browser to be responsive to screen width --> | |
| 23 | - <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | |
| 19 | + <meta charset="<?= Yii::$app->charset ?>"> | |
| 20 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 21 | + <?= Html::csrfMetaTags() ?> | |
| 22 | + <title><?= Html::encode($this->title) ?></title> | |
| 24 | 23 | <?php $this->head() ?> |
| 25 | 24 | <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
| 26 | 25 | <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> | ... | ... |