to() public static method

Get a path relative to the application
public static to ( $uri ) : string
return string
コード例 #1
0
ファイル: response.php プロジェクト: biggtfish/anchor-cms
 /**
  * Creates a response with a header to redirect
  *
  * @param string
  * @param int
  * @return object
  */
 public static function redirect($uri, $status = 302)
 {
     // Scrub all output buffer before we redirect.
     // @see http://www.mombu.com/php/php/t-output-buffering-and-zlib-compression-issue-3554315-last.html
     while (ob_get_level() > 1) {
         ob_end_clean();
     }
     return static::create('', $status, array('Location' => Uri::to($uri)));
 }