本文整理汇总了PHP中Mapper::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapper::connect方法的具体用法?PHP Mapper::connect怎么用?PHP Mapper::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Mapper
$_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');
示例2: onRouterInitialized
/**
* Add RSSCloud-related paths to the router table
*
* Hook for RouterInitialized event.
*
* @param Mapper $m URL parser and mapper
*
* @return boolean hook return
*/
function onRouterInitialized($m)
{
$m->connect('/main/rsscloud/request_notify', array('action' => 'RSSCloudRequestNotify'));
// XXX: This is just for end-to-end testing. Uncomment if you need to pretend
// to be a cloud hub for some reason.
//$m->connect('/main/rsscloud/notify',
// array('action' => 'LoggingAggregator'));
return true;
}
示例3: Routing
<?php
$routing = new Routing();
$mapper = new Mapper();
$mapper->connect(':controller/:action/:id', array('controller' => "pages", 'action' => "index", 'name' => "default"));