當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XenForo_Link::buildSubComponentLink方法代碼示例

本文整理匯總了PHP中XenForo_Link::buildSubComponentLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Link::buildSubComponentLink方法的具體用法?PHP XenForo_Link::buildSubComponentLink怎麽用?PHP XenForo_Link::buildSubComponentLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XenForo_Link的用法示例。


在下文中一共展示了XenForo_Link::buildSubComponentLink方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildLink

 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if ($action == 'categories' && isset($data['categorytitle'])) {
         $data['title'] = $data['categorytitle'];
     }
     return XenForo_Link::buildSubComponentLink($this->_getSubcomponents(), $outputPrefix, $action, $extension, $data);
 }
開發者ID:NixFifty,項目名稱:XenForo-SimplePortal,代碼行數:7,代碼來源:Lpmanage.php

示例2: buildLink

 /**
  * @param $originalPrefix
  * @param $outputPrefix
  * @param $action
  * @param $extension
  * @param $data
  * @param array $extraParams
  * @return false|string
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $parts = explode('/', $action, 2);
     $subComponentName = strtolower($parts[0]);
     if ($subComponentName === 'photos') {
         if (isset($data['photo_id']) && !isset($data['content_id'])) {
             $data['content_id'] = $data['photo_id'];
         }
         if (isset($data['title']) && $data['title'] == $data['content_id']) {
             $data['title'] = '';
         }
     }
     if ($subComponentName === 'videos') {
         if (isset($data['title']) && $data['title'] == $data['content_id']) {
             $data['title'] = '';
         }
     }
     if ($subComponentName === 'locations' && isset($data['location_url'])) {
         $data['location_url'] = sonnb_XenGallery_Model_Gallery::getTitleForUrl($data['location_url']);
     }
     if ($subComponentName === 'cameras' && isset($data['camera_url'])) {
         $data['camera_url'] = sonnb_XenGallery_Model_Gallery::getTitleForUrl($data['camera_url']);
     }
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, '');
     }
     return $link;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:38,代碼來源:XenGallery.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)
 {
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         if ($data && isset($data['resource_title'])) {
             $data['title'] = $data['resource_title'];
         }
         if (isset($extraParams['review']) && is_array($extraParams['review'])) {
             $extraParams['resource_rating_id'] = $extraParams['review']['resource_rating_id'];
             unset($extraParams['review']);
         }
         $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'resource_id', 'title');
     }
     return $link;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:21,代碼來源:Resources.php

示例4: buildLink

 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $csrf = false;
     if (isset($extraParams['t'])) {
         $csrf = true;
         unset($extraParams['t']);
     }
     // special params to banning
     if (!empty($data[Nobita_Teams_Banning::BANNING_ID_KEY])) {
         $banData = Nobita_Teams_Banning::getBanningParamsFromData($data);
         if ($banData) {
             $extraParams['team_id'] = $banData[0];
             $extraParams['type'] = $banData[1];
             $extraParams['user_id'] = $banData[2];
         }
         unset($data[Nobita_Teams_Banning::BANNING_ID_KEY]);
     }
     // comment extraData
     if (!empty($data['comment_type']) && !empty($data['team_id'])) {
         $extraParams['comment_type'] = $data['comment_type'];
         $extraParams['team_id'] = $data['team_id'];
         $extraParams[$data['comment_type'] . '_id'] = $data['post_id'];
     }
     if ($csrf) {
         // set csrf token into last params
         $extraParams['t'] = XenForo_Visitor::getInstance()->csrf_token_page;
     }
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         $action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
         if (is_array($data) && !empty($data['custom_url'])) {
             $link = XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'custom_url');
         } else {
             if ($data && isset($data['team_title'])) {
                 $data['title'] = $data['team_title'];
             }
             $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'team_id', 'title');
         }
     }
     return $link;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:41,代碼來源:Teams.php


注:本文中的XenForo_Link::buildSubComponentLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。