Mapper::connect PHP Method

connect() public static method

public static connect ( $url, $route )
    public static function connect($url, $route)
    {
        $url = self::normalize($url);
        self::instance()->routes[$url] = rtrim($route, '/');
    }

Usage Example

Example #1
0
        $_COOKIE = magic_quotes_stripquotes($_COOKIE);
        $_REQUEST = magic_quotes_stripquotes($_REQUEST);
    } else {
        $_GET = magic_quotes_stripslashes($_GET);
        $_POST = magic_quotes_stripslashes($_POST);
        $_COOKIE = magic_quotes_stripslashes($_COOKIE);
        $_REQUEST = magic_quotes_stripslashes($_REQUEST);
    }
}
/**
 * routes
 */
// create a request mapper object to regex-match the URI to a Route
$request = new Mapper();
// add a new Route
$request->connect('static/:staticresource', array('requirements' => array('[A-Za-z0-9_.]+')));
// load static-file-cache and debug aspects
//include $GLOBALS['PATH']['plugins'] . 'renderer.php';
// this doesn't do anything because the aspect-filter was deleted XXX
//$request->routematch();
$request->connect('admin', array('action' => 'index', 'resource' => 'admin'));
/**
 * read the configuration file
 */
include $GLOBALS['PATH']['library'] . 'yaml.php';
$loader = new Horde_Yaml();
if (file_exists($app . 'config.yml')) {
    extract($loader->load(file_get_contents($app . 'config.yml')));
    extract(${$env}['enable_db']);
} else {
    $env = array('app_folder' => 'app');
All Usage Examples Of Mapper::connect