public function actionAbout() { $content = Content::findOne(1); $cats = $content->cats; print_r($cats); die; return $this->render('about', ['test' => $cats]); }
public function actionEditcontent($id) { $model = Content::findOne($id); if ($model->load(Yii::$app->request->post())) { $model->save(); $this->refresh(); } return $this->render('edit_content', ['model' => $model]); }
public function actionIndex() { $model = new ContentForm(); $contentModel = Content::findOne(1); if ($model->load(Yii::$app->request->post())) { } else { return $this->render('index', ['model' => $model, 'contentModel' => $contentModel]); } }
/** * Finds the Content model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Content the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Content::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
'fbLink' => '', //<-- this is the link to your division facebook account, leave it blank if you don't use it 'vkLink' => '', //<-- this is the link to your division Vkontakte account, leave it blank if you don't use it 'divisionSite' => '' //<-- this is the link to your division site, leave it blank if you don't use it 'adminsvids' => [11111,00000], //<-- the list of administator's VID's. It's mandatory to fill at least one VID 'languages' => ['ru'=>'Русский','en'=>'English'], //<-- list of available briefing languages, you can configure it as you wish. Change this before install 'api_url' => 'https://login.ivao.aero/index.php?url=<b>http://URL_OF_YOUR_RFE_SITE</b>/site/login', //<--change to your http(s) host. Ensure the IVAO LOGIN API is available for your domain. 'installed' => true, //<-- change to false. It's mandatory to proceed install </pre> </li> <li> Just <b>update this page</b> </li> <li> <?php try { $p = \app\models\Content::findOne(1); if (!empty($p)) { ?> <b style="color: green">Congratulations! You just install the RFE/MSE software.</b><br> Don't forget to change <b>installed</b> parameter to <b>true</b> in <b>"config/params.php"</b> <?php } } catch (\yii\base\Exception $e) { if (Yii::$app->params['installed'] === false) { echo "Something wrong... I realy do not understand this"; } else { echo "Installation can not continue due to installed parameter setted to true"; } } ?> </li>