• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XenForo_Router类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中XenForo_Router的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Router类的具体用法?PHP XenForo_Router怎么用?PHP XenForo_Router使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XenForo_Router类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: match

 /**
  *
  * @see XenForo_Route_PrefixAdmin_AddOns::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $parts = explode('/', $routePath, 3);
     switch ($parts[0]) {
         case 'languages':
             $parts = array_slice($parts, 1);
             $routePath = implode('/', $parts);
             $action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id');
             return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages');
         case 'phrases':
             $parts = array_slice($parts, 1);
             $routePath = implode('/', $parts);
             return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases');
     }
     if (count($parts) > 1) {
         switch ($parts[1]) {
             case 'languages':
                 $action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
                 $parts = array_slice($parts, 2);
                 $routePath = implode('/', $parts);
                 $action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id');
                 return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages');
             case 'phrases':
                 $action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
                 $parts = array_slice($parts, 2);
                 $routePath = implode('/', $parts);
                 return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases');
         }
     }
     return parent::match($routePath, $request, $router);
 }
开发者ID:ThemeHouse-XF,项目名称:Phrases,代码行数:35,代码来源:AddOns.php


示例2: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $action = strtolower(array_shift($components));
     if (count($components) == 1) {
         // permission/<action>, etc
         $action .= reset($components);
     } else {
         switch ($action) {
             case 'permission':
                 // permission/<group>/<permission>/<action>
                 $request->setParam('permission_group_id', array_shift($components));
                 $request->setParam('permission_id', array_shift($components));
                 break;
             case 'permission-group':
                 // permission-group/<group>/<action>
                 $request->setParam('permission_group_id', array_shift($components));
                 break;
             case 'interface-group':
                 // interface-group/<group>/<action>
                 $request->setParam('interface_group_id', array_shift($components));
                 break;
         }
         $action .= implode('', $components);
     }
     return $router->getRouteMatch('XenForo_ControllerAdmin_Permission', $action, 'permissionsDevelopment');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:32,代码来源:Permissions.php


示例3: match

 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $strParams = '';
     $slice = false;
     switch ($subPrefix) {
         case 'options':
             $controllerName = '_Options';
             $strParams = 'option_id';
             $slice = true;
             break;
         case 'layouts':
             $controllerName = '_Layouts';
             $strParams = 'layout_id';
             $slice = true;
             break;
         case 'blocks':
             $controllerName = '_Blocks';
             $strParams = 'block_id';
             $slice = true;
             break;
         case 'categories':
             $controllerName = '_Categories';
             $strParams = 'category_slug';
             $slice = true;
             break;
         default:
             $controllerName = '_Blocks';
     }
     $routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath;
     $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
     return $router->getRouteMatch('EWRporta_ControllerAdmin' . $controllerName, $action, 'EWRporta', $routePath);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:34,代码来源:EWRporta.php


示例4: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $controller = 'QCPlayers_ControllerPublic_Player';
     $routePath .= '/';
     $action = $router->resolveActionWithStringParam($routePath, $request, 'username');
     return $router->getRouteMatch($controller, $action, 'players', $routePath);
 }
开发者ID:Quartzcraft,项目名称:Website,代码行数:12,代码来源:Player.php


示例5: match

 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $controllerName = '';
     $action = '';
     $intParams = 'page_id';
     $strParams = '';
     $slice = false;
     switch ($subPrefix) {
         case 'special':
             if (!empty($components[1]) && ($components[0] == 'edit-template' || $components[0] == 'delete-template')) {
                 unset($components[1]);
             }
             $controllerName = '_Special';
             $slice = true;
             break;
         case 'archive':
             $controllerName = '_Archive';
             $intParams = 'history_id';
             $slice = true;
             break;
         default:
             $strParams = 'page_slug';
     }
     $routePathAction = implode('/', array_slice($slice ? $components : explode('/', $routePath), 0, 2)) . '/';
     $routePathAction = str_replace('//', '/', $routePathAction);
     if ($strParams) {
         $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
     } else {
         $action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams);
     }
     $action = $router->resolveActionAsPageNumber($action, $request);
     return $router->getRouteMatch('EWRcarta_ControllerPublic_Wiki' . $controllerName, $action, 'wiki', $routePath);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:35,代码来源:Wiki.php


示例6: match

 /**
  * Attempts to match the routing path. See {@link XenForo_Route_Interface} for further details.
  *
  * @param string Routing path
  * @param Zend_Controller_Request_Http Request object
  * @param XenForo_Router Routing object
  *
  * @return false|XenForo_RouteMatch
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $lastDot = strrpos($routePath, '.');
     if ($lastDot === false) {
         return false;
     }
     $lastSlash = strrpos($routePath, '/');
     if ($lastSlash !== false && $lastDot < $lastSlash) {
         return false;
     }
     $responseType = substr($routePath, $lastDot + 1);
     if ($responseType === strval(intval($responseType))) {
         return false;
     }
     $newRoutePath = substr($routePath, 0, $lastDot);
     if (!is_string($newRoutePath)) {
         $newRoutePath = '';
     }
     $match = $router->getRouteMatch();
     $match->setModifiedRoutePath($newRoutePath);
     if ($responseType !== '') {
         $match->setResponseType($responseType);
     }
     return $match;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:34,代码来源:ResponseSuffix.php


示例7: match

 /**
  * Handles routing for view page.
  **/
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     // Many thanks to Jaxel for his documentation on this (http://xenforo.com/community/threads/13605/)
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $subSplits = explode('.', $subPrefix);
     $slice = false;
     switch ($subPrefix) {
         case 'confirm':
             $controller = "Confirm";
             break;
         case 'delete':
             $controller = "Delete";
             break;
         case 'api':
             $controller = "Api";
             break;
         case 'view':
         default:
             $controller = 'View';
     }
     $routePathAction = ($slice ? implode('/', array_slice($components, 0, 2)) : $routePath) . '/';
     $routePathAction = str_replace('//', '/', $routePathAction);
     $action = $router->resolveActionWithStringParam($routePathAction, $request, "string_id");
     return $router->getRouteMatch('AssociationMc_ControllerPublic_' . $controller, $action, 'view');
 }
开发者ID:adamjdev,项目名称:XenForo-MCASSOC,代码行数:29,代码来源:View.php


示例8: match

 /**
  * Attempts to match the routing path. See {@link XenForo_Route_Interface} for further details.
  *
  * @param string $routePath Routing path
  * @param Zend_Controller_Request_Http $request Request object
  * @param XenForo_Router $router Routing object
  *
  * @return XenForo_RouteMatch|bool
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     if (!XenForo_Application::isRegistered('routeFiltersIn')) {
         return false;
     }
     $filters = XenForo_Application::get('routeFiltersIn');
     if (!$filters) {
         return false;
     }
     foreach ($filters as $filter) {
         if (isset($filter['match_regex'])) {
             $from = $filter['match_regex'];
             $to = $filter['match_replace'];
         } else {
             list($from, $to) = XenForo_Link::translateRouteFilterToRegex(urldecode($filter['replace_route']), urldecode($filter['find_route']));
         }
         $newRoutePath = preg_replace($from, $to, $routePath);
         if ($newRoutePath != $routePath) {
             $match = $router->getRouteMatch();
             $match->setModifiedRoutePath($newRoutePath);
             return $match;
         }
     }
     return false;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:34,代码来源:Filter.php


示例9: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     if (isset($components[1]) && preg_match('#^([0-9]*)$#', $components[1], $matches)) {
         $request->setParam('chapter', $components[1]);
         $request->setParam('url_portion', $components[0]);
         unset($components[0], $components[1]);
         $action = implode('', $components);
     } elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)$#', $components[1], $matches)) {
         $request->setParam('chapter', $matches[1]);
         $request->setParam('verse', $matches[2]);
         $request->setParam('url_portion', $components[0]);
         unset($components[0], $components[1]);
         $action = implode('', $components);
     } elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)-([0-9]*)$#', $components[1], $matches)) {
         $request->setParam('chapter', $matches[1]);
         $request->setParam('verse', $matches[2]);
         $request->setParam('verse_to', $matches[3]);
         $request->setParam('url_portion', $components[0]);
         unset($components[0], $components[1]);
         $action = implode('', $components);
     } else {
         $action = $router->resolveActionWithStringParam($routePath, $request, 'url_portion');
     }
     return $router->getRouteMatch('ThemeHouse_Bible_ControllerPublic_Bible', $action, 'bible');
 }
开发者ID:ThemeHouse-XF,项目名称:Biblea,代码行数:31,代码来源:Bible.php


示例10: match

 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithIntegerParam($routePath, $request, 'id');
     $routeMatch = $router->getRouteMatch('Dark_TaigaChat_ControllerPublic_TaigaChat', $action, 'taigachat', $routePath);
     //$routeMatch->setResponseType('jsonText');
     return $routeMatch;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:TaigaChat.php


示例11: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $parts = explode('/', $routePath, 2);
     $controllerPart = str_replace(array('-', '/'), ' ', strtolower($parts[0]));
     $controllerPart = str_replace(' ', '', ucwords($controllerPart));
     $action = isset($parts[1]) ? $parts[1] : '';
     return $router->getRouteMatch('XenForo_ControllerPublic_InlineMod_' . $controllerPart, $action, 'forums');
 }
开发者ID:Sywooch,项目名称:forums,代码行数:13,代码来源:InlineMod.php


示例12: match

 /**
  *
  * @see XenForo_Route_Prefix_Index::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $xenOptions = XenForo_Application::get('options');
     if ($xenOptions->th_noForo_noForum) {
         return $router->getRouteMatch('XenForo_ControllerPublic_Index', 'index', 'home');
     }
     return parent::match($routePath, $request, $router);
 }
开发者ID:ThemeHouse-XF,项目名称:NoForo,代码行数:12,代码来源:Index.php


示例13: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller);
     if ($action === false) {
         $action = $router->resolveActionWithIntegerParam($routePath, $request, 'profile_post_id');
     }
     return $router->getRouteMatch('XenForo_ControllerPublic_ProfilePost', $action, 'members');
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:13,代码来源:ProfilePosts.php


示例14: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     if (preg_match('#^auto/(.*)$#i', $routePath, $match)) {
         $action = 'auto' . $router->resolveActionWithIntegerParam($match[1], $request, 'auto_warning_id');
         return $router->getRouteMatch('XenForo_ControllerAdmin_Warning', $action, 'userWarnings');
     }
     return parent::match($routePath, $request, $router);
 }
开发者ID:ThemeHouse-XF,项目名称:AutoWarning,代码行数:13,代码来源:Warnings.php


示例15: match

 /**
  * @see XenForo_Route_Interface::match()
  * @param $routePath
  * @param \Zend_Controller_Request_Http $request
  * @param \XenForo_Router $router
  * @return \XenForo_RouteMatch
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $customIndex = XenForo_Application::get('customIndex');
     if ($customIndex->params) {
         $request->setParams($customIndex->params->toArray());
     }
     return $router->getRouteMatch($customIndex->controllerClass, $routePath, $customIndex->majorSection, $customIndex->minorSection);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:15,代码来源:Index.php


示例16: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $controller = 'XenGallery_ControllerPublic_Redirects_XenMedio';
     $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller);
     if ($action == false) {
         $action = $router->resolveActionWithIntegerParam($routePath, $request, 'media_id');
     }
     return $router->getRouteMatch($controller, $action);
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:14,代码来源:XenMedio.php


示例17: match

 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     if (in_array($routePath, array('add', 'save'))) {
         $action = $routePath;
     } else {
         $action = $router->resolveActionWithIntegerParam($routePath, $request, 'log_id');
     }
     return $router->getRouteMatch('bdApi_ControllerAdmin_Log', $action, 'bdApi');
 }
开发者ID:billyprice1,项目名称:bdApi,代码行数:9,代码来源:Log.php


示例18: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $controller = 'ThreePointStudio_CustomMarkupForUser_ControllerAdmin_CMFU';
     $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller);
     if ($action === false) {
         $action = $router->resolveActionWithIntegerParam($routePath, $request, 'preset_id');
     }
     return $router->getRouteMatch($controller, $action, 'users', '3ps-cmfu/');
 }
开发者ID:iversia,项目名称:3ps_cmfu,代码行数:14,代码来源:CMFU.php


示例19: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithIntegerParam($routePath, $request, 'node_id');
     if (!class_exists('XFCP_ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory', false)) {
         $createClass = XenForo_Application::resolveDynamicClass('XenForo_ControllerAdmin_Forum', 'controller');
         eval('class XFCP_ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory extends ' . $createClass . ' {}');
     }
     return $router->getRouteMatch('ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory', $action, 'nodeTree');
 }
开发者ID:AndroidOS,项目名称:SocialGroups,代码行数:14,代码来源:SocialCategories.php


示例20: match

 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithIntegerParam($routePath, $request, 'tag_id');
     $majorSection = 'Tinhte_XenTag_Tag';
     if (empty($action) or strtolower($action) == 'index') {
         $majorSection = 'threadsPosts';
     }
     return $router->getRouteMatch('Tinhte_XenTag_ControllerAdmin_Tag', $action, $majorSection);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:9,代码来源:Tag.php



注:本文中的XenForo_Router类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XenForo_Template_Abstract类代码示例发布时间:2022-05-23
下一篇:
PHP XenForo_Permission类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap