/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Sysmenus::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['menu_id' => $this->menu_id, 'menu_parent_id' => $this->menu_parent_id, 'menu_order' => $this->menu_order, 'menu_status' => $this->menu_status]);
     $query->andFilterWhere(['like', 'menu_slug', $this->menu_slug])->andFilterWhere(['like', 'menu_name', $this->menu_name])->andFilterWhere(['like', 'menu_url', $this->menu_url])->andFilterWhere(['like', 'menu_title', $this->menu_title])->andFilterWhere(['like', 'menu_type', $this->menu_type])->andFilterWhere(['like', 'menu_icon', $this->menu_icon]);
     return $dataProvider;
 }
コード例 #2
0
"></i><span><?php 
        echo Yii::t('menu', $module["menu_title"]);
        ?>
 </span><?php 
        echo AWS_PULL_RIGHT;
        ?>
			</a>
			<ul class="<?php 
        echo AWS_TREE_VIEW;
        ?>
">
			<?php 
        foreach ($submodules as $kSubModules => $submodule) {
            ?>
			<?php 
            $menus = Sysmenus::findChildren($submodule["menu_id"]);
            ?>
			<?php 
            $active = 'inactive';
            if (isset($activeURI[2])) {
                if (!empty($activeURI[1]) && ($submodule['module'] == $activeURI[1] || $submodule['module'] == $activeURI[2])) {
                    $active = AWS_ACTIVE;
                }
                if (!empty($submodule["menu_slug"]) && $activeSlug["menu_url"] == Yii::$app->requestedRoute) {
                    // special modules -____-
                    if ($activeURI[0] == 'user') {
                        $active = AWS_ACTIVE;
                    }
                }
            } else {
                if (!empty($activeURI[1]) && $submodule['module'] == $activeURI[1]) {
コード例 #3
0
 /**
  * Finds the Sysmenus model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Sysmenus the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Sysmenus::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }