mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 22:02:12 +00:00
b3b362a9e6
- Fixed errors with getRoute method. - Added Response and Request classes. - Added CSRF stuff. - Cleanup and bugfixes.
27 lines
415 B
PHP
27 lines
415 B
PHP
<?php
|
|
|
|
namespace Pecee\Http;
|
|
|
|
class Response {
|
|
|
|
/**
|
|
* Set the http status code
|
|
*
|
|
* @param int $code
|
|
* @return self $this
|
|
*/
|
|
public function httpCode($code) {
|
|
http_response_code($code);
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Redirect the response
|
|
*
|
|
* @param string $url
|
|
*/
|
|
public function redirect($url) {
|
|
header('location: ' . $url);
|
|
}
|
|
|
|
} |