Exemplo n.º 1
0
use yii\helpers\Html;
if ($model->user->status != 2) {
    ?>
    <div class="panel-event-box bordered-grey">
        <div class="row">
            <div class="col-xs-4">
                <?php 
    echo Html::img($model->user->avatar, ['class' => 'img-thumbnail img-responsive', 'alt' => $model->user->fullname]);
    ?>
            </div>
            <div class="col-md-8">
                <div class="title-texts">
                    <span class="font-medium fonts-bold"><?php 
    echo $model->user->fullname;
    ?>
</span>
                    <p class="color-black"><?php 
    echo yii\helpers\StringHelper::truncate($model->entry, 50);
    echo Yii::$app->user->identity->level != 0 ? "<span class='label label-info pull-right'>" . Html::a('Read more', ['journal/view/' . $model->id], ['class' => 'color-white']) . "</span>" : " ";
    ?>
</p>
                    <span class="users-list-date"><?php 
    echo Yii::$app->formatter->asDate($model->date, 'long');
    ?>
</span>
                </div>
            </div>
        </div>
    </div>
<?php 
}
Exemplo n.º 2
0
use yii\helpers\Html;
if ($model->user->status != 2) {
    ?>
    <div class="panel-event-box bordered-grey center">
        <div class="row">
            <div class="col-xs-4">
                <?php 
    echo Html::img($model->user->avatar, ['class' => 'img-thumbnail img-responsive center-blocked', 'alt' => $model->user->fullname]);
    ?>
            </div>
            <div class="col-md-8">
                <div class="title-texts">
                    <span class="font-medium fonts-bold"><?php 
    echo $model->user->fullname;
    ?>
</span>
                    <p class="color-black"><?php 
    echo yii\helpers\StringHelper::truncate($model->title, 50);
    echo Yii::$app->user->identity->level != 0 ? "<span class='label label-info pull-right'>" . Html::a('Read more', ['event/view/' . $model->id], ['class' => 'color-white']) . "</span>" : " ";
    ?>
</p>
                    <span class="users-list-date"><?php 
    echo Yii::$app->formatter->asDate($model->date, 'long');
    ?>
</span>
                </div>
            </div>
        </div>
    </div>
<?php 
}
Exemplo n.º 3
0
<?php

use yii\grid\GridView;
use yii\data\ActiveDataProvider;
/* @var $this yii\web\View */
/* @var $model mosesfender\articles\models\Articles */
/* @var $searchModel mosesfender\articles\models\ArticlesSearch */
echo $this->renderFile(realpath(__DIR__ . "/../layout/topmenu.php"));
?>

<div>
    <?php 
$dataProvider = new ActiveDataProvider(['query' => $searchModel->find(), 'pagination' => ['pageSize' => 5]]);
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'id'], ['attribute' => 'art_title', 'content' => function ($data) {
    return yii\helpers\StringHelper::truncate($data->toArray()["art_title"], 60);
}], ['attribute' => 'cat_id', 'label' => yii::t("articles", "Cat Title"), 'content' => function ($data) {
    /* @var $data mosesfender\articles\models\ArticlesSearch */
    return $data->category["cat_title"];
}], ['attribute' => 'status', 'content' => function ($data) {
    /* @var $data mosesfender\articles\models\ArticlesSearch */
    return $data->enabled;
}], ['class' => 'yii\\grid\\ActionColumn'], ['attribute' => 'created_at', 'format' => ['datetime']], ['attribute' => 'update_at', 'format' => ['datetime']]]]);
?>
</div>
<div class="form-group">
    <a class="btn btn-primary btn-xs" href="<?php 
echo yii\helpers\Url::toRoute("articles/create");
?>
"><?php 
echo Yii::t("articles", "New Article");
?>