public function actionView($slug)
 {
     $article = Article::get($slug);
     if (!$article) {
         throw new \yii\web\NotFoundHttpException('Article not found.');
     }
     return $this->render('view', ['article' => $article]);
 }
 public function actionView($slug)
 {
     $article = Article::get($slug);
     if (!$article) {
         throw new \yii\web\NotFoundHttpException('Article not found.');
     }
     $article_items = Article::last_items(3, $article->model->item_id);
     return $this->render('view', ['article' => $article, 'article_items' => $article_items]);
 }
Example #3
0
 public function actionArticle()
 {
     if (Yii::$app->request->get('slug')) {
         return $this->render('article-item', ['slug' => Yii::$app->request->get('slug')]);
     }
     if (Yii::$app->request->get('category')) {
         $category = Article::cat(Yii::$app->request->get('category'));
     } else {
         $category = Article::cat();
     }
     $menuItems = [];
     foreach ($category->model->getBehavior('tree')->parents(1)->one()->children(1)->all() as $item) {
         $menuItems[] = ['label' => $item->title, 'url' => ['site/article', 'category' => $item->slug]];
     }
     return $this->render('article-category', ['category' => $category, 'menuItems' => $menuItems]);
     return $this->render('article-category');
 }
Example #4
0
 public function init()
 {
     $items = [['label' => 'Главная', 'url' => '/']];
     $page = Page::find()->one();
     if ($page) {
         $items[] = ['label' => 'О компании', 'url' => ['site/page', 'slug' => $page->slug]];
     }
     foreach (Article::tree() as $articleCategory) {
         $item['label'] = $articleCategory->title;
         if (count($articleCategory->children) > 0) {
             $item['url'] = ['site/article', 'category' => $articleCategory->children[0]->slug];
         } else {
             $item['url'] = ['site/article', 'category' => $articleCategory->slug];
         }
         $items[] = $item;
     }
     $items[] = ['label' => 'Новостная лента', 'url' => ['site/news']];
     $this->items = $items;
 }
Example #5
0
        <?php 
echo News::last()->short;
?>
    </blockquote>
</div>

<br/>
<hr/>


<div class="text-center">
    <h2>Last article from category #1</h2>
    <br/>
    <div class="row text-left">
        <?php 
$article = Article::last(1, ['category_id' => 1]);
?>
        <div class="col-md-2">
            <?php 
echo Html::img($article->thumb(160, 120));
?>
        </div>
        <div class="col-md-10 text-left">
            <?php 
echo Html::a($article->title, ['articles/view', 'slug' => $article->slug]);
?>
            <br/>
            <?php 
echo $article->short;
?>
        </div>
Example #6
0
<?php

/**
 * @author: Vasya Zhuryk <*****@*****.**>
 * @version 1.0
 */
use yii\easyii\modules\article\api\Article;
$this->title = 'Контакты';
?>
<div class="jumbotron">
    <?php 
echo Article::get('page-contacts')->model->text;
?>
</div>
Example #7
0
<h1><?php 
echo Article::get('home-about')->model->title;
?>
</h1>

<p>
    <?php 
echo News::get('main-page')->text;
?>
</p>

<div class="row marketing">

    <?php 
foreach (Article::last(2, ['category_id' => 3]) as $item) {
    ?>

        <div class="col-lg-6">

            <h4><?php 
    echo $item->model->title;
    ?>
</h4>
            <p><?php 
    echo $item->model->text;
    ?>
</p>

        </div>
Example #8
0
        </div>
        <div class="col col-2">
            <div id="qr-code">
                <img src="/uploads/data/qr.jpg">
            </div>
        </div>
        <div class="col col-4">
            <div class="block-head">
                <h3>Свежие статьи</h3>
                <span class="eng-title">Corporate Information</span>
            </div>
            <div class="news">
                <ul>
                    <?php 
foreach (Article::last(5) as $news) {
    ?>
                        <li>
                            <span class="icon">●</span>
                            <a class="title" href="<?php 
    echo Yii::$app->urlManager->createUrl(['site/article', 'slug' => $news->slug]);
    ?>
"><?php 
    echo $news->title;
    ?>
</a>
                            <span class="date">[<?php 
    echo $news->date;
    ?>
]</span>
                        </li>
Example #9
0
 /**
  * @return string
  */
 public function actionEasls()
 {
     $slug = \Yii::$app->request->get('s');
     $page = Article::get($slug);
     return $this->render('easls', ['page' => $page]);
 }
Example #10
0
echo $page->title;
?>
</h1>
<div class="clearfix pad_top13">
    <div class="col-md-8">
        <p class="row">
            <span class="bold">Specializes in Non-veg , 65, Thanthuri, Sandwich, 65 smoked sandwich.</span><br/><br/> Our team of highly qualified professionals headed by an experienced Chef. Lnim ad minim veniam, quis nostrud.<br /><br />

            Exercitation ullamco laboris nisi ut aliquip ex ea commodo. Duis aute dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla  do tempore ercitationem ut labore. et dolore magna aliqua.<br /><br />

            Ut labore et dolore magna aliqua. Ut enim ad consequatur quis nostrud exercitation ullamco. Exercitationem ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adi pisi cing elit, sed do eiusmod tempor.							</p>
    </div>
    <div class="col-md-4">
        <div class="right_content ">
            <div class="sub_title">
                <h4><?php 
echo $page->title;
?>
</h4>
            </div>

            <ul>
                <?php 
foreach (Article::tree() as $node) {
    echo renderNode($node);
}
?>
            </ul>
        </div>
    </div>
</div>
Example #11
0
        <?php 
echo News::last() ? News::last()->short : "";
?>
    </blockquote>
</div>

<br/>
<hr/>


<div class="text-center">
    <h2>Последние статьи</h2>
    <br/>
    <div class="row text-left">
        <?php 
$article = Article::last();
?>
        <div class="col-md-2">
            <?php 
echo $article ? Html::img($article->thumb(160, 120)) : "";
?>
        </div>
        <div class="col-md-10 text-left">
            <?php 
echo $article ? Html::a($article->title, ['articles/view', 'slug' => $article->slug]) : "";
?>
            <br/>
            <?php 
echo $article ? $article->short : "";
?>
        </div>
Example #12
0
<?php

use yii\easyii\modules\article\api\Article;
$article = Article::get($slug);
$category = Article::cat($article->cat->slug);
?>

<div class="container content-page">
    <div class="row">
        <div class="col col-3 left-col">

            <?php 
$items = [];
foreach ($category->items() as $item) {
    $items[] = ['label' => $item->title, 'url' => ['site/article', 'slug' => $item->slug]];
}
?>
            <?php 
echo \yii\widgets\Menu::widget(['items' => $items, 'options' => ['id' => 'left-menu']]);
?>
        </div>
        <div class="col col-7 right-col">
            <h1><?php 
echo $article->title;
?>
</h1>

            <div class="content">
                <?php 
echo $article->text;
?>
Example #13
0
        <?php 
$this->head();
?>
    </head>


    <body>
    <?php 
$this->beginBody();
?>
    <div class="container">

        <div class="header clearfix">
            <nav>
                <?php 
echo Menu::widget(['items' => [['label' => 'Главная', 'url' => ['main/index']], ['label' => 'О нас', 'url' => ['main/about']], ['label' => 'Медиа', 'url' => ['main/media']], ['label' => Article::last(1, ['category_id' => 4])->model->title, 'url' => ['main/easls', 's' => Article::last(1, ['category_id' => 4])->model->slug]], ['label' => 'Другие тренинги', 'url' => ['main/other_trainings']], ['label' => 'Контакты', 'url' => ['main/contacts']]], 'options' => ['class' => 'nav nav-pills pull-right']]);
?>
            </nav>
            <h3 class="text-muted">
                <div class="main-logo white-overlay"></div>
            </h3>
        </div>
        <?php 
echo $content;
?>


        <footer class="footer">
            <div style="float:left;">&copy; EaSLS <?php 
echo date('Y', time());
?>
Example #14
0
<?php

/**
 * @author: Vasya Zhuryk <*****@*****.**>
 * @version 1.0
 */
use yii\easyii\modules\article\api\Article;
$this->title = 'ЕШСС - спортивное служение';
?>
<div class="jumbotron">
    <?php 
echo Article::get('page-aboutus')->model->text;
?>
</div>

Example #15
0
 public function actionWhite_label()
 {
     $page = Page::get('page-white-label');
     $cat = Article::cat('white-label');
     if (!$cat) {
         throw new \yii\web\NotFoundHttpException('Page not found.');
     }
     return $this->render('white_label', ['page' => $page, 'cat' => $cat, 'label_items' => $cat->items()]);
 }
Example #16
0
 public function getCat()
 {
     return Article::cats()[$this->category_id];
 }
Example #17
0
<?php 
if (count($article->photos)) {
    ?>
    <div>
        <h4>Photos</h4>
        <?php 
    foreach ($article->photos as $photo) {
        ?>
            <?php 
        echo $photo->box(100, 100);
        ?>
        <?php 
    }
    ?>
        <?php 
    Article::plugin();
    ?>
    </div>
    <br/>
<?php 
}
?>
<p>
    <?php 
foreach ($article->tags as $tag) {
    ?>
        <a href="<?php 
    echo Url::to(['/articles/tag', 'slug' => $article->cat->slug, 'tag' => $tag]);
    ?>
" class="label label-info"><?php 
    echo $tag;
Example #18
0
<?php

/**
 * @author: Vasya Zhuryk <*****@*****.**>
 * @version 1.0
 */
use yii\easyii\modules\article\api\Article;
$this->title = 'Другие Тренинги';
?>
<div class="jumbotron">
    <?php 
echo Article::get('page-other-trainings')->model->text;
?>
</div>