Пример #1
0
 public function getView()
 {
     if (!ViewA::isValid($this->oView)) {
         $this->oView = new Base();
     }
     return $this->oView;
 }
Пример #2
0
 public function fetch($includePath)
 {
     $oModel = $this->getModel();
     /* @var StaticFileModel $oModel */
     if (StaticFileModel::isValid($oModel)) {
         return $oModel->getFileContent();
     } else {
         return parent::fetch($includePath);
     }
 }
Пример #3
0
 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;
 }
Пример #4
0
/* @var $this \vsc\presentation\views\RssView */
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="<?php 
echo \vsc\presentation\views\ViewA::getCurrentUri();
?>
" rel="self" type="application/rss+xml" />
		<title><?php 
echo htmlspecialchars($this->getTitle(), ENT_QUOTES, 'UTF-8');
?>
</title>
		<link><?php 
echo \vsc\presentation\views\ViewA::getCurrentSiteUri();
?>
</link>
		<description><?php 
echo htmlspecialchars($this->getDescription(), ENT_QUOTES, 'UTF-8');
?>
</description>
		<language><?php 
echo $this->getLanguage() != '' ? $this->getLanguage() : 'EN';
?>
</language>
		<lastBuildDate><?php 
echo $this->getLastBuildDate() != '' ? $this->getLastBuildDate() : date('%c');
?>
</lastBuildDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
Пример #5
0
 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;
 }
Пример #6
0
 function getTemplate()
 {
     return parent::getTemplate();
 }
Пример #7
0
 public function testEmptyGetCurrentSiteUri()
 {
     $this->assertEmpty(ViewA::getCurrentSiteUri());
 }
Пример #8
0
 /**
  * @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;
 }