diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/config/bootstrap.php')
-rw-r--r-- | fai_gestion/plugins/CustomTheme/config/bootstrap.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/config/bootstrap.php b/fai_gestion/plugins/CustomTheme/config/bootstrap.php index f90c873..7215ce7 100644 --- a/fai_gestion/plugins/CustomTheme/config/bootstrap.php +++ b/fai_gestion/plugins/CustomTheme/config/bootstrap.php @@ -38,8 +38,21 @@ EventManager::instance()->on('Bake.beforeRender.Controller.controller', function if ( is_array($actions) ) { $view->viewVars['actions'] = count($actions)?$actions:['_empty']; } + // Add Search.Prg component if we have configured filters in bake_extra.php + $controllerName = $view->viewVars['name']; + if ( $view->BakeExtra->hasFilters($controllerName) ) { + $view->viewVars['components'] += ['Search.Prg']; + } }); +EventManager::instance()->on('Bake.beforeRender.Model.table', function (Event $event) { + $view = $event->getSubject(); + // Add Search.Search behavior if we have configured filters in bake_extra.php + $controllerName = $view->viewVars['name']; + if ( $view->BakeExtra->hasFilters($controllerName) ) { + $view->viewVars['behaviors'] += ['Search.Search' => [] ]; + } +}); /* * Note : "cake bake all" behavior is customized in * plugins/CustomTheme/src/Shell/BakeShell.php |