Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.