Example #1
0
        <?php 
foreach ($posts as $post) {
    ?>
            <?php 
    $item['post_count']++;
    ?>
            <?php 
    echo PostWidget::widget(['model' => $post, 'topic' => $topic, 'count' => $item['post_count']]);
    ?>
        <?php 
}
?>
    </div>
    <?php 
if (!Yii::$app->getUser()->getIsGuest()) {
    ?>
        <?php 
    echo EditorWidget::widget(['activeFormOptions' => ['action' => Url::to(['post/view', 'id' => $topic->id, '#' => 'postform'])], 'model' => $model, 'messageAttribute' => 'message']);
    ?>
    <?php 
}
?>
    <div class="pagination-center">
        <?php 
echo LinkPager::widget(['pagination' => $dataProvider->pagination]);
?>
    </div>
</div>

<?php 
$this->registerJs("jQuery(document).post();");
Example #2
0
<?php

use yii\helpers\Url;
use terabyte\forum\components\View;
use terabyte\forum\models\Forum;
use terabyte\forum\widgets\EditorWidget;
use terabyte\forum\widgets\pageHead;
/* @var View $this
 * @var $model
 * @var Forum $forum */
$this->title = Yii::t('forum', 'Создать тему');
$this->subtitle = Yii::t('forum', 'вернуться в раздел') . ' <a href="' . Url::to(['forum/view', 'id' => $forum->id]) . '">' . $forum->name . '</a>';
$this->params['breadcrumbs'][] = ['label' => Yii::t('forum', 'Main Board'), 'url' => ['forum/index']];
$this->params['breadcrumbs'][] = ['label' => Yii::t('forum', $forum->name), 'url' => ['topic/view', 'id' => $forum->id]];
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo pageHead::widget(['title' => $this->title, 'subtitle' => $this->subtitle]);
?>

<div class="page-create-topic">
    <?php 
echo EditorWidget::widget(['model' => $model, 'titleAttribute' => 'subject', 'messageAttribute' => 'message']);
?>
</div>