Example #1
0
{
    return root() . 'assets/';
}
/* Create a routing object and pass it our URI so we can get the controller
 * action, and paramaters passed in our URI
 */
$routing = new routing(APP_BUILD_ROOT);
$route = $routing->breakURI($_SERVER['REQUEST_URI'], BUILD_URI);
define('REQUEST', $routing->request);
function self()
{
    return root() . trim(REQUEST, DS);
}
$controller = $routing->getControllerName();
$action = $routing->getActionName();
$paramaters = $routing->getParamaters();
/* Instantiate our crumbMVC controller */
$crumb_mvc = new crumbMVC(true, true, true);
try {
    /* First check to see if our URI points to a support resource (not a php
     * file)
     */
    $crumb_mvc->loadSupport($route);
    /* Check to see if the route passed in the URI actually pertains to files
     * that exist in our app
     */
    $route_exists = true;
    if (!$crumb_mvc->controllerExists($controller) || !$crumb_mvc->actionExists($controller, $action)) {
        $route_exists = false;
    }
    /* If the route doesn't exist, and we're in production mode show the 404