/**
  * Finds the Post model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Article the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Article::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException(Yii::t('app', 'Page not found'));
     }
 }
示例#2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Article::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'weight' => $this->weight, 'status_id' => $this->status_id, 'created_at' => $this->created_at, 'created_by' => $this->created_by, 'updated_at' => $this->updated_at, 'updated_by' => $this->updated_by]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'preview', $this->preview])->andFilterWhere(['like', 'text', $this->text])->andFilterWhere(['like', 'image', $this->image])->andFilterWhere(['like', 'category_id', $this->category_id])->andFilterWhere(['like', 'tag', $this->tag]);
     return $dataProvider;
 }
示例#3
0
 /**
  * Finds the Article model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Article the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Article::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#4
0
 public function actionIndex()
 {
     return $this->render('index', ['statistics' => $this->renderPartial('statistics', ['statistics' => static::statistics()]), 'news' => Article::find()->where('"name" is null')->orderBy(['id' => SORT_DESC])->limit(3)->all()]);
 }
示例#5
0
        <div class="row">
            <div class="exchangers">
                <h3>Обменники</h3>
                <img src="/images/dollar.gif" />
                <a href="https://magneticexchange.com/?p=5301" title="Magnetic Exchange - сервис обмена Perfect
                    Money, Neteller, Payza, Solid Trust Pay, Яндекс Денег, Payweb, RedPass и Paxum">
                    <img src="http://ad.magneticexchange.com/ru_125_125.gif" alt="Magnetic Exchange - сервис обмена
                        Perfect Money, Neteller, Payza, Solid Trust Pay, Яндекс Денег, Payweb, RedPass и Paxum" /></a>
                <a href="https://xchange.cc/?R=13966463495285">
                    <img src="https://xchange.cc/banner/black/125x125.gif"></a>
            </div>
            <div class="ipad">
                <iframe frameborder="0" src="//www.youtube.com/embed/s2tGLEd5x6M"></iframe>
            </div>
            <?php 
echo $this->renderFile('@app/modules/article/views/article/view.php', ['model' => Article::findOne(['name' => 'important'])]);
?>
        </div>
    </section>
    <section class="pussy">
        <div>
            <p>
                <a href="http://perfectmoney.is" title="Perfect Money - новое поколение платежных систем Интернета">
                    <img hspace="5" src="/images/perfectmoney.jpg" />
                </a>
            </p>
            <p>Программа работает по принципу одной быстро движущейся общей очереди, 1x3 под одного встают
                три приглашенных и верхний в очереди получает выплату. Приглашения по реферальной ссылке,
                реферальная программа.</p>
            <p>Участник, после регистрации выбирает вариант входа один из четырех, может заходить на все четыре.</p>