/**
  * Creates a new SeoPages model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new SeoPages();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
예제 #2
0
 public function generatePageData()
 {
     $where = ['view' => $this->route];
     $where['action_params'] = json_encode($this->actionParams);
     $page = SeoPages::find()->where($where)->with('meta')->one();
     if ($this->trackViews && $page == null) {
         $page = new SeoPages();
         $page->view = $this->route;
         $page->action_params = $this->actionParams;
         $page->save();
     } else {
         $this->setMetaTags($page->meta);
     }
 }