Guest User

Untitled

a guest
May 27th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. /**
  2.      * @param AbstractRequest $request
  3.      * @return void
  4.      */
  5.     public function postDispatch(AbstractRequest $request)
  6.     {
  7.         if ($this->getLayout()->isEnabled()) {
  8.             $currentModule = strtolower($request->getModuleName());
  9.             $path = $this->getLayout()->getLayoutPath() . $currentModule;
  10.             if (is_dir($path)) {
  11.                 $this->getLayout()->setViewScriptPath($path);
  12.                 $currentLayout = $this->getLayout()->getLayout();
  13.                 $layout = $currentModule . DIRECTORY_SEPARATOR . $currentLayout;
  14.                 $this->getLayout()->setLayout($layout);
  15.  
  16.                 // choose which navigation container to use
  17.                 $navigationContainer = $this->getLocator()->get(ucfirst($currentModule) . 'NavigationContainer');
  18.                 $this->getLayout()->getView()->assign('navigationContainer', $navigationContainer);
  19.  
  20.             }
  21.         }
  22.     }
Add Comment
Please, Sign In to add comment