Exemple #1
0
 * @var \common\components\View $this
 * @var \yii\data\ActiveDataProvider $dataProvider
 * @var array|\yii\db\ActiveRecord[] $topics
 * @var \topic\models\Topic $topic
 * @var \tag\models\Tag $tagModel
 * @var \tag\models\Tag $tag
 */
\topic\TopicAsset::register($this);
$formatter = Yii::$app->formatter;
if ($tagModel instanceof Tag) {
    $this->title = Yii::$app->formatter->asText($tagModel->short_description);
} else {
    $this->title = 'Активные темы';
}
$item['topic_count'] = 0;
$dateTimeAgo = new \common\components\DateTimeAgo();
?>
<div class="ptagged">
    <div class="question-content">
        <div class="question-list-header">
            <div class="question-list-title">
                <h3><?php 
echo $this->title;
?>
</h3>
                <?php 
echo Tabs::widget();
?>
            </div>
        </div>
        <div class="question-list">
Exemple #2
0
<?php

/* @var \common\components\View $this */
/* @var \post\models\Post $post */
use yii\helpers\Url;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use cebe\gravatar\Gravatar;
$formatter = Yii::$app->formatter;
$dateTimeAgo = new \common\components\DateTimeAgo();
?>
<div class="post <?php 
echo $count % 2 == 0 ? 'post-roweven' : 'post-rowodd';
echo $count == 1 ? ' firstpost' : '';
?>
  js-post" id="post<?php 
echo $post->id;
?>
" data-post-id="<?php 
echo $post->id;
?>
">
    <div class="post-avatar">
        <?php 
if (isset($post->user->email)) {
    ?>
        <?php 
    echo Gravatar::widget(['email' => $post->user->email, 'options' => ['alt' => $post->user->username, 'class' => 'avatar', 'width' => 48, 'height' => 48], 'defaultImage' => 'retro', 'size' => 48]);
    ?>
        <?php 
}