예제 #1
0
 /**
  * Convert the content of the Response to a string and return it.
  *
  * @return string
  */
 public function render()
 {
     // If the content is a stringable object, we'll go ahead and call
     // to toString method so that we can get the string content of
     // the content object. Otherwise we'll just cast to string.
     if (str_object($this->content)) {
         $this->content = $this->content->__toString();
     } else {
         $this->content = (string) $this->content;
     }
     // Once we obtain the string content, we can set the content on
     // the HttpFoundation's Response instance in preparation for
     // sending it back to client browser when all is finished.
     $this->foundation->setContent($this->content);
     return $this->content;
 }
예제 #2
0
 public function render()
 {
     if (str_object($this->content)) {
         $this->content = $this->content->__toString();
     } else {
         $this->content = (string) $this->content;
     }
     $this->foundation->setContent($this->content);
     return $this->content;
 }