/** * Making alias list for specified menu item type * @param integer $type Menu item type * @return void */ public function actionAlias($type) { return Json::encode(['type' => (int) $type, 'items' => Menu::getAliasList($type)]); }
?> <?php echo $form->field($model, 'name'); ?> <?php echo $form->field($model, 'type')->dropDownList(Menu::getTypeList(), $typeOptions); ?> <?php echo $form->field($model, 'url', $urlOptions); ?> <?php echo $form->field($model, 'alias', $aliasOptions)->dropDownList(Menu::getAliasList($model->type)); ?> <div class="form-group"> <div class="col-sm-offset-3 col-sm-6"> <?php echo Html::submitButton(Yii::t('menu', 'Save'), ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('menu', 'Cancel'), ['index', 'id' => $id], ['class' => 'btn btn-default']); ?> </div> </div> <?php ActiveForm::end();