示例#1
0
 /**
  * @inheritdoc
  * @return \PHPixie\Response|Response
  */
 public function send_headers()
 {
     $links = [];
     foreach ($this->links as $link) {
         $links[] = '<' . $link->getUrl() . '>' . ($link->getRel() === null ? '' : '; rel="' . $link->getRel() . '"');
     }
     if (count($links)) {
         $this->addHeader('Link', implode(',', $links));
     }
     return parent::send_headers();
 }
示例#2
0
 /**
  * Shortcut for redirecting the user.
  * Use like this:
  * <code>
  *     return $this->redirect($url);
  * </code>
  *
  * @param string $url URL to redirect to.
  * @return void
  */
 public function redirect($url)
 {
     $this->response->redirect($url);
     $this->execute = false;
 }