Beispiel #1
0
 /**
  * @name 获取方法
  */
 public function actionItems($parent, $type = 1)
 {
     switch ($type) {
         case 1:
             $mu = AuthPermission::getCtrls($parent);
             break;
         case 2:
             $mu = AuthPermission::getMethods($parent);
             break;
         default:
             # code...
             break;
     }
     \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     return ['status' => 200, 'data' => $mu];
 }
Beispiel #2
0
?>

    <?php 
echo $form->field($model, 'pid')->dropDownList($model->getMenus());
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'mod')->dropDownList(AuthPermission::getMods(), ['prompt' => '选择模块', 'class' => 'form-control mod']);
?>

    <?php 
echo $form->field($model, 'ctrl')->dropDownList(AuthPermission::getCtrls($model->mod), ['prompt' => '选择控制器', 'class' => 'form-control ctrl']);
?>

    <?php 
echo $form->field($model, 'auth_name')->dropDownList(AuthPermission::getMethods($model->ctrl), ['prompt' => '选择方法', 'class' => 'form-control method']);
?>

    <?php 
echo $form->field($model, 'icon')->textInput(['maxlength' => true]);
?>

	<!-- <div class="form-group">
        <div class="col-sm-offset-2 col-sm-3">
            <?php 
echo Html::submitButton('保 存', ['class' => 'btn btn-primary btn-block']);
?>