Commit 6be43b621c37b8c61a1909c886741e67378ff537
1 parent
17033e08
MenuSearch fix
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
backend/controllers/MenuController.php
| @@ -9,6 +9,7 @@ use yii\web\Controller; | @@ -9,6 +9,7 @@ use yii\web\Controller; | ||
| 9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
| 10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
| 11 | use common\models\TerminLang; | 11 | use common\models\TerminLang; |
| 12 | +use backend\models\SearchMenu; | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * MenuController implements the CRUD actions for Menu model. | 15 | * MenuController implements the CRUD actions for Menu model. |
| @@ -33,7 +34,7 @@ class MenuController extends Controller | @@ -33,7 +34,7 @@ class MenuController extends Controller | ||
| 33 | */ | 34 | */ |
| 34 | public function actionIndex() | 35 | public function actionIndex() |
| 35 | { | 36 | { |
| 36 | - $searchModel = new MenuSearch(); | 37 | + $searchModel = new SearchMenu(); |
| 37 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | 38 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
| 38 | 39 | ||
| 39 | return $this->render('index', [ | 40 | return $this->render('index', [ |
common/models/Menu.php
| @@ -51,5 +51,9 @@ class Menu extends \yii\db\ActiveRecord | @@ -51,5 +51,9 @@ class Menu extends \yii\db\ActiveRecord | ||
| 51 | 'sortorder' => Yii::t('app', 'Sortorder'), | 51 | 'sortorder' => Yii::t('app', 'Sortorder'), |
| 52 | ]; | 52 | ]; |
| 53 | } | 53 | } |
| 54 | - | 54 | + |
| 55 | + public function getTermin_lang() | ||
| 56 | + { | ||
| 57 | + return $this->hasMany(Menu::className(), ['termin_id' => 'termin_id']); | ||
| 58 | + } | ||
| 55 | } | 59 | } |