<?php /* @var $this yii\web\View */ /* @var $category Category */ use common\models\Category; use frontend\components\ArticleList; use frontend\utilities\FrontEndHelper; $this->title = $category->title; $this->params['categoryId'] = $category->id; if ($category->description) { echo '<div class="description">'; echo FrontEndHelper::parseContent($category->description); echo '</div>'; } if ($category->articles) { echo ArticleList::widget(['items' => $category->articles, 'articlesColumnsCount' => 1, 'withImage' => true, 'maxImageWidth' => 250, 'parentType' => 'category']); }
<?php /* @var $this yii\web\View */ /* @var $content \common\models\Category */ use frontend\components\ArticleList; use frontend\utilities\FrontEndHelper; echo '<body>'; echo '<h1>' . $content->title . '</h1>'; if ($content->description) { echo '<div class="description category">'; echo FrontEndHelper::parsePdfContent($content->description); echo '</div>'; } if ($content->articles) { echo ArticleList::widget(['items' => $content->articles, 'columnsCount' => 1, 'maxImageWidth' => 200]); } echo '</body>';