original_string: public function onControllerSetup(Event $event)
      {
          /** @var AppController $controller */
          $controller = $event->getSubject();
          $isAdmin    = ($controller->request->getParam('prefix') === 'admin');
  
          $plugins = Plugin::loaded();
          foreach ($plugins as $plugin) {
              $path     = Plugin::path($plugin);
              $menuFile = ($isAdmin) ? 'admin_menu' : 'menu';
              $navConf  = $path . 'config/' . $menuFile . '.php';
  
              if (FS::isFile($navConf)) {
                  /** @noinspection PhpIncludeInspection */
                  require_once $navConf;
              }
          }
      }
code: public function onControllerSetup(Event $event)
      {
          /** @var AppController $controller */
          $controller = $event->getSubject();
          $isAdmin    = ($controller->request->getParam('prefix') === 'admin');
  
          $plugins = Plugin::loaded();
          foreach ($plugins as $plugin) {
              $path     = Plugin::path($plugin);
              $menuFile = ($isAdmin) ? 'admin_menu' : 'menu';
              $navConf  = $path . 'config/' . $menuFile . '.php';
  
              if (FS::isFile($navConf)) {
                  /** @noinspection PhpIncludeInspection */
                  require_once $navConf;
              }
          }
      }
code_tokens: public function onControllerSetup ( Event $ event ) { /** @var AppController $controller */ $ controller = $ event -> getSubject ( ) ; $ isAdmin = ( $ controller -> request -> getParam ( 'prefix' ) === 'admin' ) ; $ plugins = Plugin :: loaded ( ) ; foreach ( $ plugins as $ plugin ) { $ path = Plugin :: path ( $ plugin ) ; $ menuFile = ( $ isAdmin ) ? 'admin_menu' : 'menu' ; $ navConf = $ path . 'config/' . $ menuFile . '.php' ; if ( FS :: isFile ( $ navConf ) ) { /** @noinspection PhpIncludeInspection */ require_once $ navConf ; } } }
docstring: On controller setup.
  
  @param   Event $event
  @return  void
docstring_tokens: On controller setup .