Beispiel #1
0
<div class="blog-comment-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Module::t('blog', 'Create ') . Module::t('blog', 'Blog Comment'), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn'], 'id', 'parent_id', ['attribute' => 'post_id', 'value' => function ($model) {
    return mb_substr($model->post->title, 0, 15, 'utf-8') . '...';
}], ['attribute' => 'content', 'value' => function ($model) {
    return mb_substr(Yii::$app->formatter->asText($model->content), 0, 30, 'utf-8') . '...';
}], 'author', 'email:email', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === Status::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status === Status::STATUS_INACTIVE) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->getStatus()->label . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', Status::labels(), ['class' => 'form-control', 'prompt' => Module::t('blog', 'PROMPT_STATUS')])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Beispiel #2
0
echo $form->field($model, 'content')->textarea(['rows' => 6]);
?>

	<?php 
echo $form->field($model, 'author')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'url')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'status')->dropDownList(\sircovsw\blog\models\Status::labels());
?>

	<div class="form-group">
		<?php 
echo Html::submitButton($model->isNewRecord ? Module::t('blog', 'Create') : Module::t('blog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
	</div>

	<?php 
ActiveForm::end();
?>

</div>
Beispiel #3
0
    ?>
</td>
				<td><?php 
    echo $item['sort_order'];
    ?>
</td>
				<td><?php 
    echo $item['template'];
    ?>
</td>
				<td><?php 
    echo BlogCatalog::getOneIsNavLabel($item['is_nav']);
    ?>
</td>
				<td><?php 
    echo \sircovsw\blog\models\Status::labels()[$item['status']];
    ?>
</td>
				<td>
					<a href="<?php 
    echo \Yii::$app->getUrlManager()->createUrl(['blog/blog-catalog/create', 'parent_id' => $item['id']]);
    ?>
" title="<?php 
    echo Module::t('blog', 'Add Sub Catelog');
    ?>
" data-pjax="0"><span
							class="glyphicon glyphicon-plus-sign"></span></a>
					<a href="<?php 
    echo \Yii::$app->getUrlManager()->createUrl(['blog/blog-catalog/view', 'id' => $item['id']]);
    ?>
"" title="<?php