Fixing functions that need to be static
This commit is contained in:
+4
-2
@@ -36,7 +36,7 @@ class Response{
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
public function getInstance() : Response {
|
||||
public static function getInstance() : Response {
|
||||
if (!isset(self::$_instance)) {
|
||||
return self::newObj();
|
||||
}
|
||||
@@ -159,9 +159,11 @@ class Response{
|
||||
* @ctag Response::redirect($url, $code);
|
||||
*
|
||||
*/
|
||||
public static function redirect($url, $code = 302){
|
||||
public static function redirect($url, $code = 303){
|
||||
$instance = self::getInstance();
|
||||
|
||||
$instance->_code = $code;
|
||||
|
||||
if(is_ajax_request()){
|
||||
return $instance->json(['location' => $url])->send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user