예제 #1
0
 /**
  * Renders and returns the HTTP response body.
  *
  * @return string
  */
 public function getRenderedBody()
 {
     if (empty($this->body) || is_string($this->body)) {
         return (string) $this->body;
     }
     return $this->body->toString();
 }
예제 #2
0
 /**
  * Renders the view and prints it.
  *
  * @return void
  */
 public function render()
 {
     if ($this->layout !== null) {
         ob_start();
         parent::render();
         $content = ob_get_clean();
         $this->layout->setInnerContent($content);
         $this->layout->render();
     } else {
         parent::render();
     }
 }
예제 #3
0
 /**
  * Sets the storage object which will be used for caching the rendered view.
  *
  * @param \YapepBase\Storage\IStorage $storage        The object for caching.
  * @param array                       $keyModifiers   Associative array which holds the keys and values,
  *                                                    what will take into consideration in the caching process.
  * @param int                         $ttl            Time to leave in seconds.
  *
  * @return void
  *
  * @throws \YapepBase\Exception\Exception   If the storage has benn already set.
  */
 public function setStorage(IStorage $storage, array $keyModifiers, $ttl)
 {
     parent::setStorage($storage, $keyModifiers, $ttl);
 }