Created
January 12, 2018 16:22
-
-
Save bjoerne2/e612283826bd6ea40dd846f0a8b80496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MY_Router extends CI_Router { | |
protected function _parse_routes() | |
{ | |
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['_method'])) { | |
$old_server_method = $_SERVER['REQUEST_METHOD']; | |
$_SERVER['REQUEST_METHOD'] = strtoupper($_POST['_method']); | |
} | |
try { | |
parent::_parse_routes(); | |
} finally { | |
if (isset($old_server_method)) { | |
$_SERVER['REQUEST_METHOD'] = $old_server_method; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment