Exemplo n.º 1
0
 /**
  * Render template. If it is ajax request - result will be
  * put in 'html' => $result and outputted as JSON.
  *
  * If it is simple request from browser - result will be outputted as string.
  *
  * @param $localPath
  * @param array $data
  * @throws \UnderflowException
  * @return void
  */
 public function render($localPath, array $data = [])
 {
     if (!$this->controller) {
         throw new \UnderflowException('You must set controller before calling this method.');
     }
     $view = $this->controller->getView();
     if ($this->request->isAjaxRequest()) {
         $this->json(['html' => $view->renderPartial($localPath, $data)]);
     } else {
         echo $view->render($localPath, $data);
     }
 }
Exemplo n.º 2
0
 protected function init()
 {
     parent::init();
     $this->view->getLayout()->assignData(['curLink' => 'setup', 'pageHeader' => 'Setup mysql connection', 'pageTitle' => 'Setup mysql connection']);
 }
Exemplo n.º 3
0
 protected function init()
 {
     parent::init();
     $this->view->getLayout()->curLink = 'generalLog';
     $this->view->getLayout()->assignData(['pageTitle' => 'General log']);
 }