本文整理匯總了PHP中XenForo_Router::addRule方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Router::addRule方法的具體用法?PHP XenForo_Router::addRule怎麽用?PHP XenForo_Router::addRule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Router
的用法示例。
在下文中一共展示了XenForo_Router::addRule方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: route
/**
* Routes the request.
*
* @see XenForo_Dependencies_Abstract::route()
*/
public function route(Zend_Controller_Request_Http $request)
{
$router = new XenForo_Router();
$router->addRule(new XenForo_Route_ResponseSuffix(), 'ResponseSuffix')->addRule(new XenForo_Route_Prefix('admin'), 'PrefixAdmin');
return $router->match($request);
}
示例2: init_router_public
public static function init_router_public(XenForo_Dependencies_Abstract $dependencies, XenForo_Router $router)
{
$rules = $router->getRules();
$router->resetRules();
// insert our filter as the first rule
$router->addRule(new WidgetFramework_Route_Filter_PageX(), 'WidgetFramework_Route_Filter_PageX');
foreach ($rules as $ruleName => $rule) {
$router->addRule($rule, $ruleName);
}
}
示例3: getRouter
/**
* @return XenForo_Router
*/
public function getRouter()
{
$router = new XenForo_Router();
$router->addRule(new XenForo_Route_ResponseSuffix(), 'ResponseSuffix')->addRule(new XenForo_Route_Prefix('admin'), 'PrefixAdmin');
return $router;
}
示例4: getRouter
/**
* @return XenForo_Router
*/
public function getRouter()
{
$router = new XenForo_Router();
$router->addRule(new XenForo_Route_ResponseSuffix(), 'ResponseSuffix')->addRule(new XenForo_Install_Route(), 'Install');
return $router;
}
示例5: getRouter
/**
* @return XenForo_Router
*/
public function getRouter()
{
$router = new XenForo_Router();
$router->addRule(new XenForo_Route_Filter(), 'Filter')->addRule(new XenForo_Route_ResponseSuffix(), 'ResponseSuffix')->addRule(new XenForo_Route_Prefix('public'), 'Prefix');
XenForo_CodeEvent::fire('init_router_public', array($this, $router));
return $router;
}
示例6: route
/**
* Routes the request.
*
* @see XenForo_Dependencies_Abstract::route()
*/
public function route(Zend_Controller_Request_Http $request)
{
$router = new XenForo_Router();
$router->addRule(new XenForo_Route_ResponseSuffix(), 'ResponseSuffix')->addRule(new XenForo_Install_Route(), 'Install');
return $router->match($request);
}
示例7: initRouterPublic
public static function initRouterPublic(XenForo_Dependencies_Abstract $dependencies, XenForo_Router $router)
{
$router->addRule(new ThemeHouse_ShorterRoutes_Route_ShorterRoute('public'), 'ShorterRoute');
}
示例8: init_router_public
public static function init_router_public(XenForo_Dependencies_Abstract $dependencies, XenForo_Router $router)
{
if (WidgetFramework_Option::get('indexNodeId') > 0) {
// one of our widget pages was selected as the index page
// modify the router rules to serve http://domain.com/xenforo/page-x urls
$rules = $router->getRules();
$router->resetRules();
// insert our filter as the first rule
$router->addRule(new WidgetFramework_Route_Filter_PageX(), 'WidgetFramework_Route_Filter_PageX');
foreach ($rules as $ruleName => $rule) {
$router->addRule($rule, $ruleName);
}
}
}