Beispiel #1
0
 /**
  * Adds a HTTP header.
  *
  * On Wikipedia you can find a {@link http://en.wikipedia.org/wiki/List_of_HTTP_headers list of HTTP headers}.
  * If a Locaton header is added, the status code will also be automatically
  * set to 302 Found if the current status code is 200 OK.
  * @param string $name the name of the header
  * @param string $value the value of the header
  * @return null
  * @throws zibo\ZiboException when the provided name is empty or invalid
  * @throws zibo\ZiboException when the provided value is empty or invalid
  * @see setHeader()
  */
 public function addHeader($name, $value)
 {
     $header = new Header($name, $value);
     if ($header->getName() == Header::HEADER_LOCATION && !$this->willRedirect()) {
         $this->setStatusCode(self::STATUS_CODE_FOUND);
     }
     $this->headers->addHeader($header);
 }