當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。