Exemplo n.º 1
0
 public function actionIndex()
 {
     $model = new FooterForm();
     $footer = Tpl::find()->where(['key' => 'footer'])->one();
     if ($model->load(\Yii::$app->request->post())) {
         $footer->code = $model->code;
         $footer->style = $model->style;
         $footer->save();
         return \Yii::$app->response->redirect('footer');
     } else {
         $model->code = $footer->code;
         $model->style = $footer->style;
         return $this->render('index', ['model' => $model]);
     }
 }
Exemplo n.º 2
0
 public static function get_footer()
 {
     $footer = Tpl::find()->where(['key' => 'footer'])->one();
     eval('?>' . $footer->code . '<?php;');
 }