add UploadController 'rest' controller

This commit is contained in:
2015-11-27 15:27:46 +01:00
parent 4e82c8ce71
commit 40509961cd
7 changed files with 111 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ use yii\filters\AccessControl;
use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
use backend\models\UploadForm;
/**
* Site controller
@@ -22,7 +23,7 @@ class SiteController extends Controller
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'actions' => ['login', 'error','upload-image'],
'allow' => true,
],
[
@@ -55,7 +56,6 @@ class SiteController extends Controller
public function actionIndex()
{
Yii::$app->security->generatePasswordHash('test');
return $this->render('index');
}
@@ -85,4 +85,11 @@ class SiteController extends Controller
return $this->goHome();
}
public function actionUploadImage(){
\yii::$app->request->enableCsrfValidation = false;
$model = new UploadForm();
return $this->render('upload', ['model' =>$model]);
}
}