Ejemplo n.º 1
1
echo Html::a("<i class='fa fa-hashtag'></i>", ['@ticket/view', 'id' => $model->id, '#' => $answerId], ['class' => 'name']);
?>
    <?php 
if ($answer->spent) {
    ?>
        <?php 
    echo Html::tag('span', Yii::t('hipanel:ticket', 'Time spent: {n}', ['n' => Yii::$app->formatter->asDuration($answer->spent * 60)]), ['class' => 'spent-time pull-right label label-info']);
    ?>
    <?php 
}
?>
</div>
<div class="clearfix"></div>

<?php 
echo Html::tag('span', Thread::parseMessage($answer->message), ['class' => 'body']);
?>

<?php 
if (!empty($answer->files)) {
    echo $this->render('_attachments', ['model' => $answer]);
}
?>

<?php 
echo Html::endTag('div');
?>

<?php 
echo Html::beginTag('div', ['class' => 'comment-footer']);
?>
 /**
  * @return mixed|string
  */
 public function actionPreview()
 {
     $request = Yii::$app->request;
     if ($request->isAjax) {
         $text = $request->post('text');
         if ($text) {
             return Thread::parseMessage($text);
         }
     }
     Yii::$app->end();
 }