public function getView() { if (!ViewA::isValid($this->oView)) { $this->oView = new Base(); } return $this->oView; }
public function getOutput() { $sResponseBody = null; $oView = null; if (ViewA::isValid($this->getView())) { $this->setContentType($this->getView()->getContentType()); } else { $this->setContentType('*/*'); } $oRequest = vsc::getEnv()->getHttpRequest(); try { if (!$oRequest->isHead() && !$this->isRedirect()) { $oView = $this->getView(); $sResponseBody = $oView->getOutput(); } else { $this->setContentLength(0); } } catch (ExceptionResponseError $r) { $this->setStatus($r->getCode()); if (ViewA::isValid($oView)) { $oView->setModel(new ErrorModel($r)); $sResponseBody = $oView->getOutput(); } } return $sResponseBody; }
public function getView() { if (!ViewA::isValid($this->oView) && !is_null($this->sViewPath)) { if (stristr(basename($this->sViewPath), '.') === false && !is_file($this->sViewPath)) { $sClassName = $this->sViewPath; } elseif (is_file($this->sViewPath)) { $sViewPath = $this->getViewPath(); try { include $sViewPath; } catch (\Exception $e) { \vsc\_e($e); } $sClassName = SiteMapA::getClassName($sViewPath); } } if (!empty($sClassName)) { $this->oView = new $sClassName(); } return $this->oView; }
/** * @returns ViewA * @throws ExceptionView */ public function getView() { if (ViewA::isValid($this->oView)) { return $this->oView; } if (ViewA::isValid($this->getMap()->getView())) { return $this->getMap()->getView(); } $this->oView = $this->getDefaultView(); return $this->oView; }