mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[BUGFIX] Improvements
- Fixed errors with getRoute method. - Added Response and Request classes. - Added CSRF stuff. - Cleanup and bugfixes.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user