protected function findModel($id)
 {
     if (($model = Content::findOne($id)) !== null) {
         //           $model->load(['views' => $model->views++]);
         //           $model->save();
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Content::find();
     $query->where(['class' => $params['class']]);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'class' => $this->class, 'content' => $this->content, 'createdby' => $this->createdby, 'createdon' => $this->createdon, 'updatedon' => $this->updatedon, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'seo_url', $this->seo_url])->andFilterWhere(['like', 'image', $this->image]);
     return $dataProvider;
 }
Esempio n. 3
0
</h1>
            </div>
        </div>
    </div>
</header>

<!-- page -->
<section class="pt-medium pb-medium">
    <div class="container">
        <div class="row">
            <!-- sub menu -->
            <aside id="sidebar" class="col-md-3">
                <nav class="sidebar-menu mb-xs">
                    <ul>
                        <?php 
foreach (Content::findAll(['class' => 'uslugy', 'status' => Content::STATUS_PUBLISHED]) as $element) {
    ?>
                            <li><?php 
    echo Html::a($element->name, ['/content/site/view-by-url', 'url' => $element->seo_url, 'view' => 'view_uslugy'], ['class' => $element->id == $model->id ? 'active' : '']);
    ?>
</li>
                        <?php 
}
?>
                    </ul>
                </nav>
            </aside>
            <!-- / sub menu -->
            <!-- content -->
            <section class="col-md-9">
                <div class="row">
Esempio n. 4
0
</p>
                </article>               
            </section>
            <!--right column-->
            <aside class="col-lg-3 col-md-3 col-sm-3">
                <!--Popular articles-->
                <figure class="widget shadow r_corners wrapper m_bottom_30">
                    <figcaption>
                        <h3 class="color_light">Это интересно</h3>
                    </figcaption>
                    <div class="widget_content">
                        <?php 
$first = true;
?>
                        <?php 
foreach (Content::find()->where(['class' => 'blog', 'status' => Content::STATUS_PUBLISHED])->orderBy('RAND()')->limit(3)->all() as $model) {
    ?>
                            <?php 
    echo $first ? '<hr class="m_bottom_15">' : '';
    ?>
 
                            <?php 
    $first = false;
    ?>
                            <article class="clearfix m_bottom_15">
                                <?php 
    echo Html::img(Image::thumb($model->image, 80, 80), ['class' => 'f_left m_right_15 m_sm_bottom_10 f_sm_none f_xs_left m_xs_bottom_0']);
    ?>
                                <?php 
    echo Html::a($model->name, ['/content/site/view-by-url', 'url' => $model->seo_url, 'view' => 'view'], ['class' => 'color_dark d_block bt_link p_vr_0']);
    ?>
Esempio n. 5
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use common\modules\content\models\Content;
use andreosoft\image\Image;
?>
<!--slider with banners-->
<section class="container">
    <div class="row clearfix">

        <div class="col-lg-12 col-md-12 col-sm-12 m_xs_bottom_30">
            <div id="owl-demo" class="owl-carousel owl-theme">
                <?php 
foreach (Content::findAll(['class' => 'carusel', 'status' => Content::STATUS_PUBLISHED]) as $model) {
    ?>
                <div class="item"><?php 
    echo Html::img(Image::thumb($model->image, 1140, 416));
    ?>
</div>
                <?php 
}
?>
            </div>
        </div>
    </div>
</section>
Esempio n. 6
0
                <!-- /.kopa-entry-list -->
                <!-- Pagination -->
                <?php 
echo LinkPager::widget(['pagination' => $pagination]);
?>
 
            </div>
            <!-- /.kopa-main-col -->

            <div class="sidebar col-md-3 pt-70">

                <div class="widget kopa-article-list-widget article-list-1">
                    <h3 class="widget-title style3">Популярное:</h3>
                    <ul class="clearfix">
                        <?php 
foreach (Content::find()->where(['status' => Content::STATUS_PUBLISHED, 'class' => 'blog'])->limit(5)->orderBy('views desc')->all() as $model) {
    ?>
                            <li>
                                <article class="entry-item clearfix">
                                    <div class="entry-thumb">
                                        <?php 
    echo Html::a(Html::img(Image::thumb($model->image, 76, 76)), ['view-by-url', 'url' => $model->seo_url, 'view' => 'blog']);
    ?>
                                    </div>
                                    <div class="entry-content">
                                        <h6 class="entry-title style1"><?php 
    echo Html::a($model->name, ['view-by-url', 'url' => $model->seo_url, 'view' => 'blog']);
    ?>
<span></span></h6>
                                        <span class="entry-date"><i class="fa fa-calendar"></i><?php 
    echo $model->publishedondate;
Esempio n. 7
0
echo $model->content;
?>
</p>

                    </div>
                    <!-- End Text -->
                </div>
                <!-- End Post -->
                <!-- Prev/Next Post -->
                <div class="clearfix mt-40">
                    <?php 
$seo_url = Content::find()->where(['class' => $model->class, 'status' => Content::STATUS_PUBLISHED])->orderBy('publishedon desc')->one()->seo_url;
if ($seo_url != $model->seo_url) {
    echo Html::a('<i class="fa fa-angle-left"></i>&nbsp;Предыдущая новость', ['view-by-url', 'url' => $seo_url, 'view' => 'blog'], ['class' => 'blog-item-more left']);
}
$seo_url = Content::find()->where(['class' => $model->class, 'status' => Content::STATUS_PUBLISHED])->orderBy('publishedon asc')->one()->seo_url;
if ($seo_url != $model->seo_url) {
    echo Html::a('Следующая новость &nbsp;<i class="fa fa-angle-right"></i>', ['view-by-url', 'url' => $seo_url, 'view' => 'blog'], ['class' => 'blog-item-more right']);
}
?>
                </div>
                <!-- End Prev/Next Post -->

            </div>
            <!-- End Content -->

        </div>

    </div>
</section>
<!-- End Section -->
Esempio n. 8
0
                    <li><a href="#" class="fa fa-facebook"></a></li>
                    <li><a href="#" class="fa fa-twitter"></a></li>
                    <li><a href="#" class="fa fa-google-plus"></a></li>
                </ul>
            </div>

            <p class="copyright">Copyrights &copy; 2015</p>
        </div>            

    </div>
    <!-- humberger menu -->

    <div class="home-top-carousel loading">
        <div class="owl-carousel owl-home-top-carousel">
        <?php 
foreach (Content::findAll(['class' => 'carusel']) as $model) {
    ?>
            <div class="item">
                <?php 
    echo Html::a(Html::img(Image::thumb($model->image, 1920, 922)), '#');
    ?>
                <span class="right-bg"></span>      
                <div class="caption">
                    <h5><?php 
    echo $model->name;
    ?>
</h5>   
                    <p><?php 
    echo $model->content;
    ?>
</p> 
Esempio n. 9
0
                        </article> 
                        <!-- entry item -->
                        <div class="kopa-divide"></div>

                    </div>

                </div>
                <!-- main column -->

                <div class="sidebar col-md-3 col-sm-12">

                    <div class="widget kopa-article-list-widget article-list-1">
                        <h3 class="widget-title style3">Читайте также:</h3>
                        <ul class="clearfix">
                       <?php 
foreach (Content::find()->where(['status' => Content::STATUS_PUBLISHED, 'class' => 'blog'])->andWhere('id <> ' . $model->id)->limit(5)->orderBy('RAND()')->all() as $model) {
    ?>
                            <li>
                                <article class="entry-item clearfix">
                                    <div class="entry-thumb">
                                        <?php 
    echo Html::a(Html::img(Image::thumb($model->image, 76, 76)), ['view-by-url', 'url' => $model->seo_url, 'view' => 'blog']);
    ?>
                                    </div>
                                    <div class="entry-content">
                                        <h6 class="entry-title style1"><?php 
    echo Html::a($model->name, ['view-by-url', 'url' => $model->seo_url, 'view' => 'blog']);
    ?>
<span></span></h6>
                                        <span class="entry-date"><i class="fa fa-calendar"></i><?php 
    echo $model->publishedondate;
Esempio n. 10
0
    </div>
</section>
<!--End Our Team-->

<!-- Divider -->
<hr class="mt-0 mb-0 " />
<!-- End Divider -->

<!-- Ask About Us -->
<section class="small-section bg-dark bg-dark-alfa-90 fullwidth-slider" data-background="<?php 
echo \Yii::$app->assetManager->publish('@common/themes/samidel/assets/images/photo_for_template/2.jpg')[1];
?>
">
<?php 
foreach (Content::find()->where(['class' => 'ask', 'status' => Content::STATUS_PUBLISHED])->all() as $model) {
    ?>
    <!-- Slide Item -->
    <div>
        <div class="container relative">
            <div class="row">
                <div class="col-md-8 col-md-offset-2 align-center">
                    <!-- Section Icon -->
                    <div class="section-icon">
                        <span class="icon-quote"></span>
                    </div>
                    <!-- Section Title -->
                    <h3 class="small-title font-alt"><?php 
    echo $model->name;
    ?>
</h3>