$parentCatalog = ArrayHelper::merge([0 => Module::t('blog', 'Root Catalog')], ArrayHelper::map(CmsCatalog::get(0, CmsCatalog::find()->asArray()->all()), 'id', 'label')); unset($parentCatalog[$model->id]); ?> <div class="cms-catalog-form"> <?php $form = ActiveForm::begin(['options' => ['class' => 'form-horizontal', 'enctype' => 'multipart/form-data'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-2\">{hint}{error}</div>", 'labelOptions' => ['class' => 'col-lg-1 control-label']]]); ?> <?php echo $form->field($model, 'parent_id')->dropDownList($parentCatalog); ?> <?php echo $form->field($model, 'page_type')->dropDownList(CmsCatalog::getCatalogPageTypeLabels())->hint(Module::t('wechat', 'Page need content')); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'surname')->textInput(['maxlength' => 128]); ?> <?php echo $form->field($model, 'brief')->textInput(['maxlength' => 1022]); ?> <?php
?> <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 CmsCatalog::getCatalogPageTypeLabels($item['page_type']); ?> </td> <td><?php echo \clh021\wechat_ionic1\models\YesNo::labels()[$item['is_nav']]; ?> </td> <td><?php echo \clh021\wechat_ionic1\models\Status::labels()[$item['status']]; ?> </td> <td> <?php if ($item['page_type'] == CmsCatalog::PAGE_TYPE_LIST) { ?> <a href="<?php
<?php use yii\helpers\Html; use yii\widgets\DetailView; use clh021\wechat_ionic1\Module; /* @var $this yii\web\View */ /* @var $model app\models\CmsCatalog */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Module::t('wechat', 'Cms Catalogs'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="cms-catalog-view"> <p> <?php echo Html::a(Module::t('wechat', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Module::t('wechat', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('wechat', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'parent_id', 'value' => $model->parent_id ? $model->parent->title : Module::t('wechat', 'Root Catalog')], 'title', 'surname', 'brief', 'content:ntext', 'seo_title', 'seo_keywords', 'seo_description', 'banner', ['attribute' => 'is_nav', 'value' => \clh021\wechat_ionic1\models\YesNo::labels($model->is_nav)], 'sort_order', ['attribute' => 'page_type', 'value' => \clh021\wechat_ionic1\models\CmsCatalog::getCatalogPageTypeLabels($model->page_type)], 'page_size', 'template_list', 'template_show', 'template_page', 'redirect_url:url', ['attribute' => 'status', 'value' => \clh021\wechat_ionic1\models\Status::labels($model->status)], 'created_at:datetime', 'updated_at:datetime']]); ?> </div>