Created
August 28, 2015 06:32
-
-
Save shaunlee/5e3ef1dee18eb248f0e7 to your computer and use it in GitHub Desktop.
Phalcon Micro MVC Router
This file contains hidden or 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 | |
$filename = $_SERVER['REQUEST_URI']; | |
if ($i = strpos($filename, '?')) { | |
$filename = substr($filename, 0, $i); | |
} | |
if (file_exists(__DIR__ . $filename)) { | |
return false; | |
} | |
if (isset($_SERVER['PATH_INFO'])) { | |
$_GET['_url'] = $_SERVER['PATH_INFO']; | |
} else { | |
$_GET['_url'] = $_SERVER['REQUEST_URI']; | |
} | |
include 'index.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment