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
<?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 #4
0
<?php

/* @var $this yii\web\View */
use yii\easyii\modules\news\api\News;
use yii\easyii\modules\carousel\api\Carousel;
use yii\easyii\modules\article\api\Article;
$this->title = 'ЕШСС - спортивное служение';
?>
<div class="jumbotron">
    <?php 
echo Carousel::widget('1020', '300', ['interval' => 6000]);
?>
</div>

<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) {
    ?>
Example #5
0
 /**
  * @return string
  */
 public function actionEasls()
 {
     $slug = \Yii::$app->request->get('s');
     $page = Article::get($slug);
     return $this->render('easls', ['page' => $page]);
 }
Example #6
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 #7
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 #8
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>