public static function labels($id = null) { $data = [self::STATUS_ACTIVE => Module::t('cms', 'STATUS_ACTIVE'), self::STATUS_INACTIVE => Module::t('cms', 'STATUS_INACTIVE'), self::STATUS_DELETED => Module::t('cms', 'STATUS_DELETED')]; if ($id !== null && isset($data[$id])) { return $data[$id]; } else { return $data; } }
public static function labels($id = null) { $data = [self::YES => Module::t('cms', 'YES'), self::NO => Module::t('cms', 'NO')]; if ($id !== null && isset($data[$id])) { return $data[$id]; } else { return $data; } }
<?php use yii\helpers\Html; use yii\widgets\DetailView; use clh021\cms\Module; /* @var $this yii\web\View */ /* @var $model app\models\CmsCatalog */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Module::t('cms', 'Cms Catalogs'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="cms-catalog-view"> <p> <?php echo Html::a(Module::t('cms', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Module::t('cms', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('cms', '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('cms', 'Root Catalog')], 'title', 'surname', 'brief', 'content:ntext', 'seo_title', 'seo_keywords', 'seo_description', 'banner', ['attribute' => 'is_nav', 'value' => \clh021\cms\models\YesNo::labels($model->is_nav)], 'sort_order', ['attribute' => 'page_type', 'value' => \clh021\cms\models\CmsCatalog::getCatalogPageTypeLabels($model->page_type)], 'page_size', 'template_list', 'template_show', 'template_page', 'redirect_url:url', ['attribute' => 'status', 'value' => \clh021\cms\models\Status::labels($model->status)], 'created_at:datetime', 'updated_at:datetime']]); ?> </div>
<?php use yii\helpers\Html; use yii\widgets\DetailView; use clh021\cms\Module; /* @var $this yii\web\View */ /* @var $model app\models\CmsShow */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Module::t('cms', 'Cms Shows'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="cms-show-view"> <p> <?php echo Html::a(Module::t('cms', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Module::t('cms', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('cms', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'catalog_id', 'value' => $model->catalog->title], 'title', 'surname', 'brief', 'content:ntext', 'seo_title', 'seo_keywords', 'seo_description', 'banner', 'template_show', 'author', 'click', ['attribute' => 'status', 'value' => \clh021\cms\models\Status::labels($model->status)], 'created_at:datetime', 'updated_at:datetime']]); ?> </div>
<?php use yii\helpers\Html; use clh021\cms\Module; /* @var $this yii\web\View */ /* @var $model app\models\CmsShow */ $this->title = Module::t('cms', 'Update ') . Module::t('cms', 'Cms Show') . ' ' . $model->title; $this->params['breadcrumbs'][] = ['label' => Module::t('cms', 'Cms Shows'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = Module::t('cms', 'Update'); ?> <div class="cms-show-update"> <?php echo $this->render('_form', ['model' => $model]); ?> </div>
"" title="<?php echo Module::t('cms', 'View'); ?> " data-pjax="0"><span class="glyphicon glyphicon-eye-open"></span></a> <a href="<?php echo \Yii::$app->getUrlManager()->createUrl(['cms/cms-catalog/update', 'id' => $item['id']]); ?> "" title="<?php echo Module::t('cms', 'Update'); ?> " data-pjax="0"><span class="glyphicon glyphicon-pencil"></span></a> <a href="<?php echo \Yii::$app->getUrlManager()->createUrl(['cms/cms-catalog/delete', 'id' => $item['id']]); ?> "" title="<?php echo Module::t('cms', 'Delete'); ?> " data-confirm="<?php echo Module::t('cms', 'Are you sure you want to delete this item?'); ?> " data-method="post" data-pjax="0"><span class="glyphicon glyphicon-trash"></span></a> </td> </tr> <?php } ?> </tbody> </table> </div>
<?php use yii\helpers\Html; use clh021\cms\Module; /* @var $this yii\web\View */ /* @var $model app\models\CmsCatalog */ $this->title = Module::t('cms', 'Create ') . Module::t('cms', 'Cms Catalog'); $this->params['breadcrumbs'][] = ['label' => Module::t('cms', 'Cms Catalogs'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="cms-catalog-create"> <?php echo $this->render('_form', ['model' => $model]); ?> </div>
/** * @inheritdoc */ public function attributeLabels() { return ['id' => Module::t('cms', 'ID'), 'catalog_id' => Module::t('cms', 'Catalog ID'), 'title' => Module::t('cms', 'Title'), 'surname' => Module::t('cms', 'Surname'), 'brief' => Module::t('cms', 'Brief'), 'content' => Module::t('cms', 'Content'), 'seo_title' => Module::t('cms', 'Seo Title'), 'seo_keywords' => Module::t('cms', 'Seo Keywords'), 'seo_description' => Module::t('cms', 'Seo Description'), 'banner' => Module::t('cms', 'Banner'), 'template_show' => Module::t('cms', 'Template Show'), 'author' => Module::t('cms', 'Author'), 'click' => Module::t('cms', 'Click'), 'status' => Module::t('cms', 'Status'), 'created_at' => Module::t('cms', 'Created At'), 'updated_at' => Module::t('cms', 'Updated At')]; }
/** * @inheritdoc */ public static function getArrayIsNav() { return [self::IS_NAV_YES => Module::t('cms', 'YES'), self::IS_NAV_NO => Module::t('cms', 'NO')]; }
<?php echo $form->field($model, 'template_show')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'author')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'click')->textInput(); ?> <?php echo $form->field($model, 'status')->dropDownList(\clh021\cms\models\Status::labels()); ?> <div class="form-group"> <div class="col-lg-3 col-lg-offset-2"> <?php echo Html::submitButton($model->isNewRecord ? Module::t('cms', 'Create') : Module::t('cms', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> <?php ActiveForm::end(); ?> </div>
use yii\helpers\Html; use yii\grid\GridView; use yii\helpers\ArrayHelper; use clh021\cms\Module; /* @var $this yii\web\View */ /* @var $searchModel app\models\CmsShowSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('cms', 'Cms Shows'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="cms-show-index"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Module::t('cms', 'Create ') . Module::t('cms', 'Cms Show'), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', ['attribute' => 'catalog_id', 'value' => function ($model) { return $model->catalog->title; }], 'title', 'surname', 'template_show', 'click', 'updated_at:date', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>