示例#1
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Seo Categories');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="seo-category-index">

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

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'Seo Category']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
\yii\widgets\Pjax::begin(['enablePushState' => false, 'timeout' => 3000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['class' => EditableColumn::className(), 'attribute' => 'name', 'url' => ['edit-category-name']], ['class' => ToggleColumn::className(), 'attribute' => 'status', 'filter' => SeoCategoryStatus::listData(), 'filterInputOptions' => ['prompt' => 'Select Status', 'class' => 'form-control']], ['header' => 'Action', 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}']]]);
?>
    <?php 
\yii\widgets\Pjax::end();
?>

</div>
示例#2
0
/* @var $searchModel \yii2mod\cms\models\search\CmsModelSearch */
$this->title = Yii::t('app', 'Cms Pages');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="cms-model-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create Page', ['modelClass' => 'Cms Model']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
Pjax::begin(['enablePushState' => false, 'timeout' => 5000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['class' => EditableColumn::className(), 'attribute' => 'url', 'url' => ['edit-page']], ['class' => EditableColumn::className(), 'attribute' => 'title', 'url' => ['edit-page']], ['class' => '\\yii2mod\\toggle\\ToggleColumn', 'attribute' => 'status', 'filter' => CmsStatus::listData(), 'filterInputOptions' => ['prompt' => 'Select Status', 'class' => 'form-control']], ['attribute' => 'createdAt', 'value' => function ($model) {
    return date("d-M-Y", $model->createdAt);
}, 'filter' => false], ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'template' => '{view}{update}{delete}', 'buttons' => ['view' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', Url::to($model->url, true), ['title' => 'View', 'data-pjax' => 0, 'target' => '_blank']);
}]]]]);
?>
    <?php 
Pjax::end();
?>
</div>
示例#3
0
/* @var $commentModel \yii2mod\comments\models\CommentModel */
$this->title = Yii::t('yii2mod.comments', 'Comments Management');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="comments-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
Pjax::begin(['enablePushState' => false, 'timeout' => 5000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'contentOptions' => ['style' => 'max-width: 50px;']], ['attribute' => 'content', 'contentOptions' => ['style' => 'max-width: 350px;'], 'value' => function ($model) {
    return StringHelper::truncate($model->content, 100);
}], 'attribute' => 'relatedTo', ['attribute' => 'createdBy', 'value' => function ($model) {
    return $model->getAuthorName();
}, 'filter' => $commentModel::getListAuthorsNames(), 'filterInputOptions' => ['prompt' => Yii::t('yii2mod.comments', 'Select Author'), 'class' => 'form-control']], ['class' => EditableColumn::className(), 'attribute' => 'status', 'url' => ['edit-comment'], 'value' => function ($model) {
    return CommentStatus::getLabel($model->status);
}, 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => Json::encode(CommentStatus::listData()), 'value' => $model->status];
}, 'filter' => CommentStatus::listData(), 'filterInputOptions' => ['prompt' => Yii::t('yii2mod.comments', 'Select Status'), 'class' => 'form-control']], ['attribute' => 'createdAt', 'value' => function ($model) {
    return Yii::$app->formatter->asDatetime($model->createdAt);
}, 'filter' => false], ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}']]]);
?>
    <?php 
Pjax::end();
?>
</div>
示例#4
0
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'Seo']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
\yii\widgets\Pjax::begin(['enablePushState' => false, 'timeout' => 10000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'url', 'urlRule', ['class' => EditableColumn::className(), 'attribute' => 'name', 'url' => ['edit-seo-name']], ['class' => EditableColumn::className(), 'url' => ['edit-seo-status'], 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => Json::encode(SeoStatus::$editList), 'value' => $model->status];
}, 'filterInputOptions' => ['prompt' => 'Select Status', 'class' => 'form-control'], 'attribute' => 'status', 'value' => function ($model) {
    return SeoStatus::getLabel($model->status);
}, 'filter' => SeoStatus::$list], ['class' => EditableColumn::className(), 'url' => ['edit-seo-category'], 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => Json::encode(ArrayHelper::map(SeoCategoryModel::find()->active()->all(), 'id', 'name')), 'value' => $model->categoryId];
}, 'filterInputOptions' => ['prompt' => 'Select Category', 'class' => 'form-control'], 'attribute' => 'categoryId', 'value' => function ($model) {
    $categoryModel = SeoCategoryModel::findOne($model->categoryId);
    return !empty($categoryModel) ? $categoryModel->name : '';
}, 'filter' => ArrayHelper::map(SeoCategoryModel::find()->order()->all(), 'id', 'name')], ['header' => 'Action', 'class' => 'yii\\grid\\ActionColumn', 'template' => '{view}{update}{delete}', 'buttons' => ['view' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', Url::to($model->url, true), ['title' => 'View', 'data-pjax' => 0, 'target' => '_blank']);
}]]]]);
?>
    <?php 
\yii\widgets\Pjax::end();
?>

</div>
示例#5
0
文件: index.php 项目: yii2mod/base
/* @var $searchModel \app\models\UserModelSearch */
$this->title = Yii::t('user', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('user', 'Create User'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
Pjax::begin(['enablePushState' => false, 'timeout' => 10000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['class' => EditableColumn::className(), 'attribute' => 'username', 'url' => ['edit-user']], 'email:email', ['class' => EditableColumn::className(), 'attribute' => 'status', 'url' => ['edit-user'], 'value' => function ($model) {
    return UserStatus::getLabel($model->status);
}, 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => UserStatus::listData(), 'value' => $model->status];
}, 'filter' => UserStatus::listData(), 'filterInputOptions' => ['prompt' => Yii::t('user', 'Select Status'), 'class' => 'form-control']], ['attribute' => 'createdAt', 'format' => 'date', 'filter' => false], ['header' => Yii::t('user', 'Action'), 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}']]]);
?>
    <?php 
Pjax::end();
?>

</div>
示例#6
0
use yii2mod\settings\models\SettingModel;
/* @var $dataProvider \yii\data\ActiveDataProvider */
/* @var $searchModel \yii2mod\settings\models\search\SettingModelSearch */
$this->title = Yii::t('app', 'Settings');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="setting-index">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p><?php 
echo Html::a('Create Setting', ['create'], ['class' => 'btn btn-success']);
?>
</p>
    <?php 
Pjax::begin(['timeout' => 7000, 'enablePushState' => false]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', ['attribute' => 'type', 'filter' => SettingType::listData(), 'filterInputOptions' => ['prompt' => 'Select type', 'class' => 'form-control']], ['attribute' => 'section', 'filter' => ArrayHelper::map(SettingModel::find()->select('section')->distinct()->all(), 'section', 'section'), 'filterInputOptions' => ['prompt' => 'Select section', 'class' => 'form-control']], 'key', 'value:ntext', ['class' => EditableColumn::className(), 'attribute' => 'status', 'url' => ['edit-setting'], 'value' => function ($model) {
    return SettingStatus::getLabel($model->status);
}, 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => Json::encode(SettingStatus::listData()), 'value' => $model->status];
}, 'filter' => SettingStatus::listData(), 'filterInputOptions' => ['prompt' => 'Select Status', 'class' => 'form-control']], ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}']]]);
?>
    <?php 
Pjax::end();
?>
</div>
示例#7
0
$this->title = Module::t('app', 'ADMIN_COMMENT');
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'ADMIN'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="comments-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
Pjax::begin(['enablePushState' => false, 'timeout' => 5000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'contentOptions' => ['style' => 'max-width: 50px;']], ['attribute' => 'content', 'contentOptions' => ['style' => 'max-width: 350px;'], 'value' => function ($model) {
    return StringHelper::truncate($model->content, 100);
}], ['attribute' => 'createdBy', 'value' => function ($model) {
    return Html::a($model->getAuthorName(), ['/admin/user/view', 'id' => $model->getAuthorId()]);
}, 'format' => 'html', 'filter' => $commentModel::getListAuthorsNames(), 'filterInputOptions' => ['prompt' => Module::t('app', 'ADMIN_SELECT_AUTHOR_COMMENT'), 'class' => 'form-control']], ['class' => EditableColumn::className(), 'attribute' => 'status', 'url' => ['edit-comment'], 'value' => function ($model) {
    return CommentStatus::getLabel($model->status);
}, 'type' => 'select', 'editableOptions' => function ($model) {
    return ['source' => Json::encode(CommentStatus::listData()), 'value' => $model->status];
}, 'filter' => CommentStatus::listData(), 'filterInputOptions' => ['prompt' => Module::t('app', 'ADMIN_SELECT_STATUS_COMMENT'), 'class' => 'form-control']], ['attribute' => 'createdAt', 'value' => function ($model) {
    return Yii::$app->formatter->asDatetime($model->createdAt);
}, 'filter' => false], ['header' => Module::t('app', 'ADMIN_COMMENT_ACTIONS'), 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>
    <?php 
Pjax::end();
?>
</div>