当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Link::prepareExtensionAndAction方法代码示例

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


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

示例1: buildLink

 /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if ($data) {
         XenForo_Link::prepareExtensionAndAction($extension, $action);
         $actionParts = explode('/', $action, 2);
         $url = $outputPrefix . '/' . $actionParts[0];
         switch (strtolower($actionParts[0])) {
             case 'permission':
                 if (!empty($data['permission_group_id']) && !empty($data['permission_id'])) {
                     $url .= '/' . $data['permission_group_id'] . '/' . $data['permission_id'];
                 }
                 break;
             case 'permission-group':
                 if (!empty($data['permission_group_id'])) {
                     $url .= '/' . $data['permission_group_id'];
                 }
                 break;
             case 'interface-group':
                 if (!empty($data['interface_group_id'])) {
                     $url .= '/' . $data['interface_group_id'];
                 }
                 break;
         }
         if (isset($actionParts[1])) {
             $url .= '/' . $actionParts[1];
         }
         return $url . $extension;
     }
     return false;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:36,代码来源:Permissions.php

示例2: buildLink

 /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if (is_array($data) && isset($data['original_prefix'], $data['route_type'])) {
         XenForo_Link::prepareExtensionAndAction($extension, $action);
         return "{$outputPrefix}/{$data['route_type']}/{$data['original_prefix']}/{$action}{$extension}";
     } else {
         return false;
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:15,代码来源:RoutePrefixes.php

示例3: buildLink

 /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if (is_array($data)) {
         XenForo_Link::prepareExtensionAndAction($extension, $action);
         if (strpos($action, '-option') !== false) {
             if (isset($data['option_id'])) {
                 return "{$outputPrefix}/{$action}/{$data['option_id']}{$extension}";
             }
         } else {
             if (isset($data['group_id'])) {
                 return "{$outputPrefix}/{$action}/{$data['group_id']}{$extension}";
             }
         }
     }
     return false;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:22,代码来源:Options.php


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