Beispiel #1
0
    ?>
            <tr data-key="1">
                <td><?php 
    echo $item['id'];
    ?>
</td>
                <td><?php 
    echo $item['label'];
    ?>
</td>
                <td><?php 
    echo $item['sort_order'];
    ?>
</td>
                <td><?php 
    echo \common\models\YesNo::labels()[$item['is_nav']];
    ?>
</td>
                <td><?php 
    echo \common\models\Status::labels()[$item['status']];
    ?>
</td>
                <td>
                    <!--a href="<?php 
    echo \Yii::$app->getUrlManager()->createUrl(['category/create', 'parent_id' => $item['id']]);
    ?>
" title="<?php 
    echo Yii::t('app', 'Add Sub Catalog');
    ?>
" data-pjax="0"><span class="glyphicon glyphicon-plus-sign"></span></a-->
                    <a href="<?php 
Beispiel #2
0
echo $form->field($model, 'zipcode')->textInput(['maxlength' => 16]);
?>

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

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

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

    <?php 
echo $form->field($model, 'default')->dropDownList(\common\models\YesNo::labels());
?>

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

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

</div>
Beispiel #3
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Categories'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="category-view">

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', '确定要删除吗?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'parent_id', 'value' => $model->parent_id ? $model->parent->name : "根目录"], 'name', 'brief', ['attribute' => 'is_nav', 'value' => \common\models\YesNo::labels($model->is_nav)], 'banner', 'keywords', 'description:ntext', 'redirect_url:url', 'sort_order', ['attribute' => 'status', 'value' => \common\models\Status::labels($model->status)], 'created_at:datetime', 'updated_at:datetime', 'created_by', 'updated_by']]);
?>

</div>
Beispiel #4
0
<div class="address-index">

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

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create ') . Yii::t('app', 'Address'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user ? $model->user->username : '******';
}], 'name', 'consignee', ['attribute' => 'region', 'value' => function ($model) {
    return (isset($model->country0) ? $model->country0->name : '-') . (isset($model->province0) ? $model->province0->name : '-') . (isset($model->city0) ? $model->city0->name : '-') . (isset($model->district0) ? $model->district0->name : '-');
}], 'address', ['attribute' => 'default', 'format' => 'html', 'value' => function ($model) {
    if ($model->default === YesNo::YES) {
        $class = 'label-success';
    } elseif ($model->default === YesNo::NO) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . YesNo::labels($model->default) . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'default', YesNo::labels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], 'created_at:date', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Beispiel #5
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Address */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Addresses'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="address-view">

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'user_id', 'value' => $model->user ? $model->user->username : '******'], 'name', 'consignee', ['attribute' => 'region', 'value' => (isset($model->country0) ? $model->country0->name : '-') . (isset($model->province0) ? $model->province0->name : '-') . (isset($model->city0) ? $model->city0->name : '-') . (isset($model->district0) ? $model->district0->name : '-') . $model->address], 'address', 'zipcode', 'phone', 'mobile', 'email:email', ['attribute' => 'user_id', 'value' => \common\models\YesNo::labels($model->default)], 'created_at:datetime', 'updated_at:datetime', ['attribute' => 'created_by', 'value' => $model->createdBy->username], ['attribute' => 'updated_by', 'value' => $model->updatedBy->username]]]);
?>

</div>