Ejemplo n.º 1
0
 public function render(RequestConfig $config, Response $response)
 {
     if (!$config->isSilent()) {
         header('HTTP/1.1 ' . $response->getStatusCode() . ' ' . $response->getStatusMessage());
     }
     foreach ($response->getHeaders() as $name => $value) {
         header($name . ': ' . $value);
     }
     echo (string) $response->getContent();
 }
Ejemplo n.º 2
0
 public function render(RequestConfig $requestConfig, Response $response)
 {
     $this->config = $requestConfig;
     if (!$requestConfig->isSilent()) {
         header('HTTP/1.1 ' . $response->getStatusCode() . ' ' . $response->getStatusMessage());
     }
     switch ($response->getStatusCode()) {
         case 300:
         case 301:
         case 302:
         case 303:
         case 305:
         case 307:
             $this->redirect($response);
             break;
         default:
             if ($response->getStatusCode() >= 400) {
                 $this->displayError($response);
             } else {
                 $this->displaySuccess($response);
             }
     }
 }
Ejemplo n.º 3
0
 /**
  * Get presenter
  *
  * @return \Arbor\Core\Presenter
  * @since 0.1.0
  */
 protected function getPresenter()
 {
     $presenterConfig = $this->config->getPresenter();
     return new $presenterConfig['class']($this->services);
 }