Esempio n. 1
0
<?php

$form = kartik\form\ActiveForm::begin(array('id' => 'acctype-form', 'enableAjaxValidation' => false));
$list = \yii\helpers\ArrayHelper::map(app\models\Menu::find()->All(), 'id', 'label');
$list[0] = Yii::t('app', 'None');
?>

<?php 
echo $form->errorSummary($model);
echo $form->field($model, 'id');
echo $form->field($model, 'label');
?>

<?php 
echo $form->field($model, 'url');
?>

<?php 
echo $form->field($model, 'icon');
?>

<?php 
echo $form->field($model, 'parent')->widget(\kartik\select2\Select2::className(), ['data' => $list]);
echo $form->field($model, 'sort');
?>

<div class="form-actions">
    <?php 
echo \yii\helpers\Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => 'btn btn-success']);
?>
Esempio n. 2
0
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
			<?php 
echo $form->field($model, 'controller')->textInput(['maxlength' => true]);
?>
			<?php 
echo $form->field($model, 'action')->textInput(['maxlength' => true]);
?>
			<?php 
echo $form->field($model, 'icon')->textInput(['maxlength' => true]);
?>
			<?php 
echo $form->field($model, 'order')->textInput();
?>
			<?php 
echo $form->field($model, 'parent_id')->dropDownList(\yii\helpers\ArrayHelper::map(app\models\Menu::find()->all(), 'id', 'name'), ['prompt' => 'Select']);
?>
                </p>
                <?php 
$this->endBlock();
?>
                
                <?php 
echo Tabs::widget(['encodeLabels' => false, 'items' => [['label' => 'Menu', 'content' => $this->blocks['main'], 'active' => true]]]);
?>
                <hr/>
                <?php 
echo $form->errorSummary($model);
?>
                <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($model->isNewRecord ? 'Create' : 'Save'), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-success']);