Exemple #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getApps()
 {
     return $this->hasMany(App::className(), ['cp_id' => 'id']);
 }
Exemple #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getApp()
 {
     return $this->hasOne(App::className(), ['id' => 'app_id']);
 }
Exemple #3
0
 /**
  * @inheritdoc
  */
 public function controlAttributes()
 {
     return [['id' => 'basic', 'name' => '基本属性', 'attributes' => ['name' => ['type' => 'text'], 'parent_id' => ['type' => 'tree', 'pkAttrName' => 'menu_id', 'showAttrName' => 'name', 'items' => function () {
         return static::find()->asArray()->all();
     }, 'topItem' => [0 => '顶级菜单']], 'app' => ['type' => 'dropDown', 'items' => [App::className(), 'getAppsItems']], 'module' => ['type' => 'text'], 'controller' => ['type' => 'text'], 'action' => ['type' => 'text'], 'params' => ['type' => 'text', 'hint' => '额外附加到生成地址的参数,比如a=1&b=2'], 'sort' => ['type' => 'text'], 'type' => ['type' => 'dropDown', 'items' => [static::className(), 'getTypeItems']], 'auth_rules' => ['type' => 'checkbox', 'items' => [Auth::className(), 'getRuleItems']], 'remark' => ['type' => 'textarea'], 'status' => ['type' => 'radio', 'items' => [static::className(), 'getStatusItems']]]]];
 }