Ejemplo n.º 1
0
    </p>
<?php 
Pjax::begin();
?>
    <?php 
$form = ActiveForm::begin();
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'sort', 'value' => function ($model) {
    //$checkbox = Html::checkbox('fields[]',null,['class'=>'from-control fields','value'=>$model->name]);
    return Html::hiddenInput('fid[]', $model->id) . Html::textInput('sort[]', $model->sort, ['class' => 'form-control field-sort']);
}, 'format' => 'raw'], 'name', 'label', 'hint', ['attribute' => 'is_inner', 'value' => function ($model) {
    $is_inner = CmField::IS_INNER();
    return $is_inner[$model->is_inner];
}], ['attribute' => 'data_type', 'value' => function ($model) {
    $dt = CmField::dataType();
    return $dt[$model->data_type];
}], 'length', ['attribute' => 'input', 'value' => function ($model) {
    $dt = CmField::inputType();
    return $dt[$model->input];
}], ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['field-view', 'id' => $model->id], ['title' => Yii::t('app', 'View')]);
}, 'update' => function ($url, $model, $key) {
    if ($model->is_inner == 1) {
        return '';
    } else {
        return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['field-update', 'id' => $model->id], ['title' => Yii::t('app', 'View')]);
    }
}, 'delete' => function ($url, $model, $key) {
    if ($model->is_inner == 1) {
        return '';
Ejemplo n.º 2
0
echo $form->field($model, 'name')->hint(Yii::t('app', 'Used for database table field name'));
?>
        <?php 
echo $form->field($model, 'is_inner')->hiddenInput()->label(false);
?>
        <?php 
echo $form->field($model, 'old_name')->hiddenInput()->label(false);
?>
        <?php 
echo $form->field($model, 'label');
?>
        <?php 
echo $form->field($model, 'hint');
?>
        <?php 
echo $form->field($model, 'data_type')->dropDownList(CmField::dataType(), ['prompt' => Yii::t('app', 'Prompt datatype')]);
?>
        <?php 
echo $form->field($model, 'length')->hint(Yii::t('app', 'useful for string and decimal datatype'));
?>
        <?php 
echo $form->field($model, 'input')->dropDownList(CmField::inputType(), ['prompt' => Yii::t('app', 'Prompt inputtype')]);
?>
        <?php 
echo $form->field($model, 'source')->textarea()->hint(Yii::t('app', 'support key value pair per line or sql statement'));
?>
        <?php 
echo $form->field($model, 'options')->textarea()->hint(Yii::t('app', 'equal Yii Active field options'));
?>
        <div class="form-group">
            <?php