コード例 #1
0
 public function actionView($slug)
 {
     $article = Article::get($slug);
     if (!$article) {
         throw new \yii\web\NotFoundHttpException('Article not found.');
     }
     return $this->render('view', ['article' => $article]);
 }
コード例 #2
0
 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]);
 }
コード例 #3
0
ファイル: SiteController.php プロジェクト: egor-pisarev/merro
 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');
 }
コード例 #4
0
ファイル: MainMenu.php プロジェクト: egor-pisarev/merro
 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;
 }
コード例 #5
0
ファイル: index.php プロジェクト: MaoCzedun/AdCoin
        <?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>
コード例 #6
0
ファイル: contacts.php プロジェクト: Bazitron/easls
<?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>
コード例 #7
0
ファイル: index.php プロジェクト: Bazitron/easls
<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>
コード例 #8
0
ファイル: index.php プロジェクト: egor-pisarev/merro
        </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>
コード例 #9
0
ファイル: MainController.php プロジェクト: Bazitron/easls
 /**
  * @return string
  */
 public function actionEasls()
 {
     $slug = \Yii::$app->request->get('s');
     $page = Article::get($slug);
     return $this->render('easls', ['page' => $page]);
 }
コード例 #10
0
ファイル: index.php プロジェクト: rkablukov/caffeshop
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>
コード例 #11
0
ファイル: index.php プロジェクト: hogvarce/house-plastic
        <?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>
コード例 #12
0
ファイル: article-item.php プロジェクト: egor-pisarev/merro
<?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;
?>
コード例 #13
0
ファイル: main.php プロジェクト: Bazitron/easls
        <?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());
?>
コード例 #14
0
ファイル: about.php プロジェクト: Bazitron/easls
<?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>

コード例 #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()]);
 }
コード例 #16
0
 public function getCat()
 {
     return Article::cats()[$this->category_id];
 }
コード例 #17
0
ファイル: view.php プロジェクト: MaoCzedun/AdCoin
<?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;
コード例 #18
0
ファイル: other_trainings.php プロジェクト: Bazitron/easls
<?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>