Ejemplo n.º 1
0
 public function actionDelete($id)
 {
     $model = Banner::findOne($id);
     $model->delete();
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : ['index']);
     }
 }
Ejemplo n.º 2
0
 protected function findModel($id)
 {
     if (($model = Banner::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }