/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Pages::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, 'id_papka' => $this->id_papka, 'author' => $this->author, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'text', $this->text])->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }
 /**
  * PagesController implements the CRUD actions for Pages model.
  */
 function actionIndex()
 {
     $session = new Session();
     $session->open();
     if (!empty($_POST['text'])) {
         $session['text'] = $a = trim($_POST['text']);
     } else {
         $a = $session['text'];
     }
     $query = Pages::find()->where(['status' => '1'])->andWhere(['like', 'text', $a]);
     $pagination = new Pagination(['defaultPageSize' => 1, 'totalCount' => $query->count(), 'pageParam' => 'i']);
     $pages = $query->orderBy('id')->offset($pagination->offset)->limit($pagination->limit)->all();
     return $this->render('index', ['pages' => $pages, 'pagination' => $pagination, 'a' => $a]);
 }
Example #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Pages::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'content', $this->content]);
     return $dataProvider;
 }
Example #4
0
 /**
  * Finds the Pages model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Pages the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Pages::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #5
0
<?php

use frontend\models\Pages;
$controller = Yii::$app->controller->id;
$action = Yii::$app->controller->action->id;
$url = $controller . '/' . $action;
$pageModel = Pages::find()->where(['status' => 1])->all();
?>
<div class="header-logo">
    <div class="header-logo-td">
        <div class="bg-r-td"></div>
        <div class="bg-r-td-center"></div>
        <div class="bg-r-td"></div>
    </div>
</div>

<nav class="navbar navbar-default header-top-menu" role="navigation">
    <a href="/site/index" class="a-href-logo"></a>
    <div class="container">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 protected function setAdress($ch, $id)
 {
     $pag = new Pages();
     $pageins = $pag->find()->where(['status' => '1', 'id_papka' => $ch])->all();
     $i = 1;
     $in = 0;
     $listpage = [];
     $list = [];
     foreach ($pageins as $pager) {
         $listpage[$pager->id] = $i++;
         $list[++$in] = $pager->title;
     }
     return $listpage[$id];
 }
Example #7
0
 public function actionShow()
 {
     $id = Yii::$app->request->get('id');
     $model = Pages::findOne($id);
     return $this->render('blank', ['model' => $model]);
 }
Example #8
0
?>
<div class="container">
    <div class="main-name-block">
        <h1>VinnieGuitars</h1>

        <h3><b>Авторские</b><span>гитары</span></h3>
    </div>
    <div class="clearfix"></div>
    <div class="main-text-block">
        <b>Доброго времени суток!</b>

        <p>Меня зовут Макс Винник, aka Vinnie. Я гитарный мастер и владелец компании Mediator group. Одно из направлений работы
            компании - это изготовление гитар и гитарного оборудования. Принимаю заказы на изготовление практически любых
            электрогитар и бас-гитар.</p>
        <a href="<?php 
echo Pages::getUrlAbouteMe();
?>
">Подробнее</a>
    </div>
    <div class="clearfix"></div>
    <div class="catalog-main main-page">
        <ul class="submenu">
            <li>
                <a href="/site/catalog"
                   onclick=""><?php 
echo $modelCategiry['0']['name'];
?>
</a>
            </li>
            <li class="<?php 
if (isset($cat) && $cat == 2) {