/** * * @return string the rendering result of the Comments Widget for owner model */ public function displayComments() { return Comments::widget(['model' => $this->owner]); }
<?php /* @var $this yii\web\View */ use yeesoft\comments\widgets\Comments; use yeesoft\post\models\Post; use yii\helpers\Html; $this->title = $post->title; $this->params['breadcrumbs'][] = $post->title; ?> <div class="post"> <h1><?php echo Html::encode($post->title); ?> </h1> <div><?php echo $post->content; ?> </div> </div> <?php if ($post->comment_status == Post::COMMENT_STATUS_OPEN) { ?> <?php echo Comments::widget(['model' => 'post', 'model_id' => $post->id]); }
<?php /* @var $this yii\web\View */ use yeesoft\comments\widgets\Comments; use yeesoft\page\models\Page; use yii\helpers\Html; $this->title = $page->title; $this->params['breadcrumbs'][] = $page->title; ?> <div class="page"> <h1><?php echo Html::encode($page->title); ?> </h1> <div><?php echo $page->content; ?> </div> </div> <?php if ($page->comment_status == Page::COMMENT_STATUS_OPEN) { ?> <?php echo Comments::widget(['model' => Page::className(), 'model_id' => $page->id]); }
<?php /* @var $this yii\web\View */ use yeesoft\comments\widgets\Comments; use yeesoft\page\models\Page; use yii\helpers\Html; $this->title = $page->title; $this->params['breadcrumbs'][] = $page->title; ?> <div class="page"> <h1><?php echo Html::encode($page->title); ?> </h1> <div><?php echo $page->content; ?> </div> </div> <?php if ($page->comment_status == Page::COMMENT_STATUS_OPEN) { ?> <?php echo Comments::widget(['model' => 'page', 'model_id' => $page->id]); }
<?php /* @var $this yii\web\View */ use yeesoft\comments\widgets\Comments; use yeesoft\post\models\Post; /* @var $post yeesoft\post\models\Post */ $this->title = $post->title; $this->params['breadcrumbs'][] = $post->title; ?> <?php echo $this->render('/items/post.php', ['post' => $post]); ?> <?php if ($post->comment_status == Post::COMMENT_STATUS_OPEN) { ?> <?php echo Comments::widget(['model' => Post::className(), 'model_id' => $post->id]); }