Simplify routing
This commit is contained in:
parent
4be2e0ee57
commit
b4d5ed60ee
@ -232,13 +232,9 @@ function controller_methods($controller)
|
|||||||
function route()
|
function route()
|
||||||
{
|
{
|
||||||
// Get the equivalent to path info
|
// Get the equivalent to path info
|
||||||
$pi = (isset($_SERVER['PATH_INFO'])) ? str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']) : NULL;
|
$pi = (isset($_SERVER['PATH_INFO']))
|
||||||
|
? str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI'])
|
||||||
// Handle default case, without index.php
|
: '/';
|
||||||
if(empty($_SERVER['PATH_INFO']))
|
|
||||||
{
|
|
||||||
$pi = '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the routes config file
|
// Load the routes config file
|
||||||
$routes = require_once(MM_APP_PATH.'config/routes.php');
|
$routes = require_once(MM_APP_PATH.'config/routes.php');
|
||||||
|
Loading…
Reference in New Issue
Block a user