コード例 #1
0
 public function actionAddCategoryDefault()
 {
     $post = Yii::$app->request->post();
     if (isset($post["category"]) and $post["category"] != 0) {
         $id_category = $post["category"];
         $RSettings = RSettings::findOne(['type' => 'category', 'value' => $id_category]);
         $count = RSettings::find()->where(['type' => 'category'])->count();
         if (!$RSettings and $count < 6) {
             $cat = new RSettings();
             $cat->type = 'category';
             $cat->value = $id_category;
             $cat->save();
         }
     }
     $this->redirect(['cabinet/default']);
 }
コード例 #2
0
ファイル: DefaultPage.php プロジェクト: a7000q/yasvoboden
 public function getPreTexts()
 {
     return RSettings::find()->where(['type' => 'preText'])->all();
 }