Example #1
0
 public static function labels($id = null)
 {
     $data = [self::STATUS_ACTIVE => Module::t('wechat', 'STATUS_ACTIVE'), self::STATUS_INACTIVE => Module::t('wechat', 'STATUS_INACTIVE'), self::STATUS_DELETED => Module::t('wechat', 'STATUS_DELETED')];
     if ($id !== null && isset($data[$id])) {
         return $data[$id];
     } else {
         return $data;
     }
 }
Example #2
0
 public static function labels($id = null)
 {
     $data = [self::YES => Module::t('wechat', 'YES'), self::NO => Module::t('wechat', 'NO')];
     if ($id !== null && isset($data[$id])) {
         return $data[$id];
     } else {
         return $data;
     }
 }
Example #3
0
<?php

use yii\helpers\Html;
use clh021\wechat_ionic1\Module;
/* @var $this yii\web\View */
/* @var $model app\models\CmsShow */
$this->title = Module::t('wechat', 'Update ') . Module::t('wechat', 'Cms Show') . ' ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => Module::t('wechat', 'Cms Shows'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('wechat', 'Update');
?>
<div class="cms-show-update">

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

</div>
Example #4
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('wechat', 'ID'), 'catalog_id' => Module::t('wechat', 'Catalog ID'), 'title' => Module::t('wechat', 'Title'), 'surname' => Module::t('wechat', 'Surname'), 'brief' => Module::t('wechat', 'Brief'), 'content' => Module::t('wechat', 'Content'), 'seo_title' => Module::t('wechat', 'Seo Title'), 'seo_keywords' => Module::t('wechat', 'Seo Keywords'), 'seo_description' => Module::t('wechat', 'Seo Description'), 'banner' => Module::t('wechat', 'Banner'), 'template_show' => Module::t('wechat', 'Template Show'), 'author' => Module::t('wechat', 'Author'), 'click' => Module::t('wechat', 'Click'), 'status' => Module::t('wechat', 'Status'), 'created_at' => Module::t('wechat', 'Created At'), 'updated_at' => Module::t('wechat', 'Updated At')];
 }
Example #5
0
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
use clh021\wechat_ionic1\Module;
/* @var $this yii\web\View */
/* @var $searchModel app\models\CmsShowSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('wechat', '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('wechat', 'Create ') . Module::t('wechat', '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>
Example #6
0
    <?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\wechat_ionic1\models\Status::labels());
?>

    <div class="form-group">
        <div class="col-lg-3 col-lg-offset-2">
            <?php 
echo Html::submitButton($model->isNewRecord ? Module::t('wechat', 'Create') : Module::t('wechat', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    </div>

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

</div>
Example #7
0
"" title="<?php 
    echo Module::t('wechat', '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('wechat', '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('wechat', 'Delete');
    ?>
" data-confirm="<?php 
    echo Module::t('wechat', '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>
Example #8
0
<?php

use yii\helpers\Html;
use clh021\wechat_ionic1\Module;
/* @var $this yii\web\View */
/* @var $model app\models\CmsShow */
$this->title = Module::t('wechat', 'Create ') . Module::t('wechat', 'Cms Show');
$this->params['breadcrumbs'][] = ['label' => Module::t('wechat', 'Cms Shows'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="cms-show-create">

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

</div>
Example #9
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use clh021\wechat_ionic1\Module;
/* @var $this yii\web\View */
/* @var $model app\models\CmsShow */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Module::t('wechat', 'Cms Shows'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="cms-show-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' => '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\wechat_ionic1\models\Status::labels($model->status)], 'created_at:datetime', 'updated_at:datetime']]);
?>

</div>
Example #10
0
<?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>
Example #11
0
 /**
  * @inheritdoc
  */
 public static function getArrayIsNav()
 {
     return [self::IS_NAV_YES => Module::t('wechat', 'YES'), self::IS_NAV_NO => Module::t('wechat', 'NO')];
 }