Exemple #1
0
/**
 * @var $this \yii\web\View
 * @var $dataProvider \yii\data\ArrayDataProvider
 */
use app\backend\components\ActionColumn;
use app\backend\widgets\BackendWidget;
use app\backend\widgets\GridView;
use kartik\helpers\Html;
use kartik\icons\Icon;
use yii\widgets\Pjax;
$this->title = Yii::t('app', 'I18n');
$this->params['breadcrumbs'] = [$this->title];
?>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <?php 
BackendWidget::begin(['icon' => 'language', 'title' => $this->title, 'footer' => Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary'])]);
?>
        <?php 
Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['label' => Yii::t('app', 'Alias'), 'value' => function ($model, $key, $index, $column) {
    return $key;
}], ['label' => Yii::t('app', 'Local file'), 'value' => function ($model, $key, $index, $column) {
    return $model;
}], ['class' => ActionColumn::className(), 'options' => ['width' => '50px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')]]]]]);
Pjax::end();
?>
    <?php 
BackendWidget::end();
?>
</div>
use app\backend\components\ActionColumn;
use app\backend\widgets\GridView;
use yii\widgets\Pjax;
/**
 * @var $id string
 * @var $data \yii\data\ArrayDataProvider
 * @var $isRules bool
 */
?>

<?php 
Pjax::begin();
?>

<?php 
echo GridView::widget(['id' => $id, 'dataProvider' => $data, 'layout' => "{items}\n{summary}\n{pager}", 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['attribute' => 'name', 'label' => Yii::t('app', 'Name'), 'options' => ['width' => '30%']], ['attribute' => 'description', 'label' => Yii::t('app', 'Description')], ['attribute' => 'ruleName', 'visible' => $isRules], ['attribute' => 'createdAt', 'label' => Yii::t('app', 'Created at'), 'value' => function ($data) {
    return date("Y-m-d H:i:s", $data->createdAt);
}, 'options' => ['width' => '200px']], ['attribute' => 'updatedAt', 'label' => Yii::t('app', 'Updated at'), 'value' => function ($data) {
    return date("Y-m-d H:i:s", $data->updatedAt);
}, 'options' => ['width' => '200px']], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]], 'urlCreator' => function ($action, $model, $key, $index) {
    $params = is_array($key) ? $key : ['id' => (string) $key];
    if ($action != 'delete') {
        $params['type'] = $model->type;
    }
    $params[0] = $this->context->id ? $this->context->id . '/' . $action : $action;
    return \yii\helpers\Url::toRoute($params);
}]], 'tableOptions' => ['class' => 'table table-striped table-condensed table-hover']]);
?>

<?php 
Pjax::end();
Exemple #3
0
}
?>


</div>
<?php 
if (!$model->isNewRecord) {
    ?>
    <div class="row">
        <article class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
            <?php 
    echo \app\backend\widgets\GridView::widget(['dataProvider' => $warehousePhoneProvider, 'columns' => ['name', 'phone', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit-phone', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete-phone', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]]]]]);
    ?>
            <?php 
    echo $this->render('form_edit_phone', ['warehousePhone' => $warehousePhone]);
    ?>

        </article>
        <article class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
            <?php 
    echo \app\backend\widgets\GridView::widget(['dataProvider' => $warehouseEmailProvider, 'columns' => ['name', 'email', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit-email', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete-filters', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]]]]]);
    ?>

            <?php 
    echo $this->render('form_edit_email', ['warehouseEmail' => $warehouseEmail]);
    ?>
        </article>

    </div>
<?php 
}
Exemple #4
0
<?php

use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
use kartik\icons\Icon;
/**
 * @var $this yii\web\View
 * @var $searchModel app\components\SearchModel
 * @var $dataProvider yii\data\ActiveDataProvider
 */
$this->title = Yii::t('app', 'Open Graph Object');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo \app\backend\widgets\GridView::widget(['dataProvider' => $provider, 'columns' => ['id', 'object.name', 'active', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')]]]]]);
    <?php 
}
?>

    <?php 
if (!empty($model->options)) {
    ?>
        <?php 
    BackendWidget::begin(['title' => Yii::t('app', 'Product Options'), 'icon' => 'shopping-cart', 'footer' => $this->blocks['submit']]);
    ?>

        <?php 
    echo GridView::widget(['dataProvider' => $dataProvider = new ActiveDataProvider(['query' => Product::find()->where(['parent_id' => $model->id])]), 'columns' => [['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'app\\backend\\columns\\TextWrapper', 'attribute' => 'name', 'callback_wrapper' => function ($content, $model, $key, $index, $parent) {
        return $content;
    }], 'price', 'old_price', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => function ($model, $key, $index, $parent) {
        return null;
    }]], 'hover' => true]);
    ?>
        <?php 
    BackendWidget::end();
    ?>
    <?php 
}
?>
</article>
</div>
</section>
<?php 
$event = new \app\backend\events\BackendEntityEditFormEvent($form, $model);
$this->trigger(BackendProductController::EVENT_BACKEND_PRODUCT_EDIT_FORM, $event);
Exemple #6
0
        <div class="row">
            <?php 
    foreach ($model->getTypeObjects() as $key => $object) {
        ?>
                <?php 
        /** @var \app\modules\shop\models\AbstractDiscountType $object */
        ?>
                <?php 
        $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL]);
        ?>
                <article class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                    <?php 
        BackendWidget::begin(['title' => Yii::t('app', $object->type->name), 'icon' => 'cog', 'footer' => $this->blocks['submit']]);
        ?>
                    <?php 
        echo \app\backend\widgets\GridView::widget(['dataProvider' => $object::searchDiscountFilter($model->id), 'columns' => ['fullName', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'delete-filters', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]], 'url_append' => '&typeId=' . $object->type->id]]]);
        ?>

                    <?php 
        echo $this->render($object->type->add_view, ['form' => $form, 'object' => $object]);
        ?>
                    <?php 
        BackendWidget::end();
        ?>
                </article>
                <?php 
        if (($key + 1) % 2 === 0) {
            ?>
                    <div class="clearfix"></div>
                <?php 
        }