示例#1
0
                                    <?php 
    echo $model->attributeLabels()['updated_by'];
    ?>
 :
                                </label>
                                <span><?php 
    echo $model->updatedBy->username;
    ?>
</span>
                            </div>

                            <?php 
    if (!$model->isNewRecord) {
        ?>
                                <?php 
        echo $form->field($model, 'created_by')->dropDownList(User::getUsersList());
        ?>
                            <?php 
    }
    ?>

                        <?php 
}
?>

                        <div class="form-group">
                            <?php 
if ($model->isNewRecord) {
    ?>
                                <?php 
    echo Html::submitButton(Yii::t('yee', 'Create'), ['class' => 'btn btn-primary']);
示例#2
0
                <div class="col-sm-6 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'post-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'post-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'post-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'post-grid', 'actions' => [Url::to(['bulk-activate']) => Yii::t('yee', 'Publish'), Url::to(['bulk-deactivate']) => Yii::t('yee', 'Unpublish'), Url::to(['bulk-delete']) => Yii::t('yii', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/post/default', 'title' => function (Post $model) {
    return Html::a($model->title, ['/post/default/view', 'id' => $model->id], ['data-pjax' => 0]);
}], ['attribute' => 'created_by', 'filter' => yeesoft\models\User::getUsersList(), 'value' => function (Post $model) {
    return Html::a($model->author->username, ['/user/default/update', 'id' => $model->created_by], ['data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUsers'), 'options' => ['style' => 'width:180px']], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'status', 'optionsArray' => Post::getStatusOptionsList(), 'options' => ['style' => 'width:60px']], ['class' => 'yeesoft\\grid\\columns\\DateFilterColumn', 'attribute' => 'published_at', 'value' => function (Post $model) {
    return '<span style="font-size:85%;" class="label label-' . (time() >= $model->published_at ? 'primary' : 'default') . '">' . $model->publishedDate . '</span>';
}, 'format' => 'raw', 'options' => ['style' => 'width:150px']]]]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>


示例#3
0
                <div class="col-sm-6 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'page-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'page-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'page-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'page-grid', 'actions' => [Url::to(['bulk-activate']) => Yii::t('yee', 'Publish'), Url::to(['bulk-deactivate']) => Yii::t('yee', 'Unpublish'), Url::to(['bulk-delete']) => Yii::t('yii', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/page/default', 'title' => function (Page $model) {
    return Html::a($model->title, ['/page/default/view', 'id' => $model->id], ['data-pjax' => 0]);
}], ['attribute' => 'created_by', 'filter' => User::getUsersList(), 'value' => function (Page $model) {
    return Html::a($model->author->username, ['/user/default/update', 'id' => $model->created_by], ['data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUsers'), 'options' => ['style' => 'width:180px']], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'status', 'optionsArray' => Page::getStatusOptionsList(), 'options' => ['style' => 'width:60px']], ['class' => 'yeesoft\\grid\\columns\\DateFilterColumn', 'attribute' => 'published_at', 'value' => function (Page $model) {
    return '<span style="font-size:85%;" class="label label-' . (time() >= $model->published_at ? 'primary' : 'default') . '">' . $model->publishedDate . '</span>';
}, 'format' => 'raw', 'options' => ['style' => 'width:150px']]]]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>


示例#4
0
                </div>

                <div class="col-sm-6 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'trip-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'trip-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'trip-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'trip-grid', 'actions' => [Url::to(['bulk-delete']) => Yii::t('yee', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['attribute' => 'vehicle_model', 'class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/trip/default', 'title' => function (Trip $model) {
    $vehicle = $model->getVehicles()[$model->vehicle] . ' > ' . Html::encode($model->vehicle_model);
    return Html::a($vehicle, ['update', 'id' => $model->id], ['data-pjax' => 0]);
}, 'buttonsTemplate' => '{update} {delete}', 'options' => ['style' => 'width:260px']], 'city_from', 'city_to', ['attribute' => 'created_by', 'filter' => User::getUsersList(), 'value' => function (Trip $model) {
    return Html::a(Html::encode($model->author->username), ['/user/default/update', 'id' => $model->created_by], ['data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUsers')], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'type', 'optionsArray' => Trip::getTypeOptionsList(), 'options' => ['style' => 'width:60px']], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'status', 'optionsArray' => Trip::getStatusOptionsList(), 'options' => ['style' => 'width:60px']]]]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>


示例#5
0
        <div class="panel-body">

            <div class="row">
                <div class="col-sm-12 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'page-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'block-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'block-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'block-grid', 'actions' => [Url::to(['bulk-delete']) => Yii::t('yii', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['attribute' => 'slug', 'class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/block/default', 'title' => function (Block $model) {
    return Html::a($model->slug, ['/block/default/update', 'id' => $model->id], ['data-pjax' => 0]);
}, 'buttonsTemplate' => '{update} {delete}'], ['attribute' => 'created_by', 'filter' => User::getUsersList(), 'value' => function (Block $model) {
    return Html::a($model->author->username, ['/user/default/update', 'id' => $model->created_by], ['data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUsers'), 'options' => ['style' => 'width:180px']]]]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>