Exemplo n.º 1
0
 public function _meta_page()
 {
     $where['view'] = $this->_view();
     $where['action_params'] = $this->_action_params();
     $this->_page = SeoPage::find()->where($where)->with('meta')->asArray()->one();
     if (!is_null($this->_page) && $where['view']) {
         $this->renderMeta();
     }
 }
Exemplo n.º 2
0
 /**
  * Deletes an existing SeoMeta model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $model = SeoPage::find()->where(['id' => $id])->with('meta')->one();
     if (is_null($model)) {
         throw new NotFoundHttpException('The requested page does not exist.');
     } else {
         foreach ($model['meta'] as $m) {
             $m->delete();
         }
         $model->delete();
     }
     return $this->redirect(['index']);
 }