Beispiel #1
0
<p>
    <?php 
if (PostComment::getCountComments($model->id) > 0) {
    ?>
        <span class="glyphicon glyphicon-comment"></span>&nbsp; <a href="<?php 
    echo Url::to(['default/view', 'id' => $model->id, '#' => 'comments']);
    ?>
"><?php 
    echo Module::t('module', 'COMMENTS:{count}', ['count' => PostComment::getCountComments($model->id)]);
    ?>
</a> |
    <?php 
}
?>
    <?php 
if ($model->tagLinks) {
    ?>
        <span class="glyphicon glyphicon-tags"></span>&nbsp; <?php 
    echo Tags::array2string($model->tagLinks);
    ?>
    <?php 
}
?>
</p>


<?php 
echo Html::a(Module::t('module', 'READ_MORE') . ' <span class="glyphicon glyphicon-chevron-right"></span>', ['default/view', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<hr>
Beispiel #2
0
 public function getTags()
 {
     $model = new Tags();
     return $model->findTagWeights($this->maxTags);
 }
Beispiel #3
0
            <span class="glyphicon glyphicon-th-large"></span> <?php 
echo $post->category->title;
?>
        </p>
        <hr>        
        <p><?php 
echo Markdown::convert($post->content);
?>
</p>

        <?php 
if ($post->tagLinks) {
    ?>
            <hr>
            <p><span class="glyphicon glyphicon-tags"></span>&nbsp; <?php 
    echo Tags::array2string($post->tagLinks);
    ?>
</p>
        <?php 
}
?>

        <hr>

        <!-- Blog Comments -->
        <?php 
echo CommentsWidget::widget(['title' => Module::t('module', 'TITLE_COMMENTS'), 'material' => $post, 'model' => $modelComments, 'imgUser' => AvatarWidget::widget()]);
?>
    </div>
    <!-- Blog Sidebar Widgets Column -->
    <div class="col-md-4">
Beispiel #4
0
 /**
  * Возвращает опубликованые посты по тегу с пагинацией
  * @param $tag
  * @return array
  */
 public function getPublishedPostsTags($tag)
 {
     $query = Tags::findOne(['title' => $tag]);
     $countQuery = count($query->postsTag);
     $pages = new Pagination(['totalCount' => $countQuery, 'defaultPageSize' => \Yii::$app->getModule('blog')->pageSize]);
     $posts = $query->getPostsTag($pages->offset, $pages->limit)->all();
     return ['posts' => $posts, 'pages' => $pages];
 }
Beispiel #5
0
 public function init()
 {
     parent::init();
 }
Beispiel #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTag()
 {
     return $this->hasOne(Tags::className(), ['id' => 'tag_id']);
 }