本文整理匯總了PHP中XenForo_Router::getRules方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Router::getRules方法的具體用法?PHP XenForo_Router::getRules怎麽用?PHP XenForo_Router::getRules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Router
的用法示例。
在下文中一共展示了XenForo_Router::getRules方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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);
}
}
示例2: 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);
}
}
}