Example #1
0
/**
 * include and run given route 
 *
 * @param Route   $route   the route to be loaded
 * @param Request $request the request datas
 *
 * @return string the produced HTML to render
 *
 * @access public
 */
function load(Route $route, Request $request)
{
    $location = explode('::', $route->getLocation());
    include_once $location[0] . '/init.php';
    $request->addParams($route->getOptions());
    return call_user_func($location[1], $request);
}