Fix customer backend forms , fix site\index

backend create\update customer forms must display the same as the frontend
forms

site\index action should be friendly and related to this app
This commit is contained in:
2015-11-02 18:41:36 +01:00
parent ed1e0b6c2a
commit b6b5193120
10 changed files with 53 additions and 113 deletions

View File

@@ -75,7 +75,12 @@ class CardController extends \backend\controllers\BackendController
$model->status = Card::STATUS_ACTIVE;
$model->type = Card::TYPE_RFID;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_card]);
\Yii::$app->session->setFlash( 'success','Card created!' );
if ( isset($_POST['create_next'])){
return $this->redirect(['create' ]);
}else{
return $this->redirect(['view', 'id' => $model->id_card]);
}
} else {
return $this->render('create', [
'model' => $model,