Example #1
0
 /**
  * All core actions should pass their view through this method in order wrap
  * some common elements around it.
  *
  * @param Buan\View
  * @return Buan\View
  */
 private function wrapper($slotView)
 {
     // Prepare the GlobalView
     // We want to use our own template, overriding the application author's
     // own GlobalViewController.
     // Because we can't guarantee that the author is not caching their GlobalView
     // instance, we'll need to store a reference to it in the $slotView.
     // Any subsequent calls to View::getGlobalView() in child slots should be
     // replaced with $GV
     $GV = View::getGlobalView();
     $GV->setSource(Config::get('core.dir.views') . '/global-view/index.tpl.php');
     $GV->html = new HtmlView($GV);
     $slotView->GV = $GV;
     // Create a View for rendering the SystemLog
     $slView = new View();
     $slView->setSource(Config::get('core.dir.views') . '/system-log.tpl.php');
     $GV->attachViewToSlot($slView, 'system-log');
     // Result
     return $slotView;
 }