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


PHP X_Env::routeLink方法代碼示例

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


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

示例1: getPlayable

 /**
  * get a playable resource url
  * from an $url (or a resource id if $isId = true)
  * @param string $url the hoster page or resource ID
  * @param boolean $isId
  * @return string a playable url
  */
 function getPlayable($url, $isId = true)
 {
     if (!$isId) {
         $url = $this->getResourceId($url);
     }
     // TODO find alternative
     return X_Env::routeLink('veoh', 'video', array('id' => $url));
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:15,代碼來源:Veoh.php

示例2: bmscriptAction

 public function bmscriptAction()
 {
     $linkAll = X_Env::routeLink('megavideo', 'bookmarklets', array('type' => 'list'));
     $linkSingle = X_Env::routeLink('megavideo', 'bookmarklets', array('type' => 'video'));
     $linkSingleCategoryRequest = X_Env::_('megavideo_bookmarklets_category_selection');
     $paginationRequest = X_Env::_('megavideo_bookmarklets_lotoflinks');
     $allpagesearchRequest = X_Env::_('megavideo_bookmarklets_nolinksinselectioncontinue');
     $statusWindowLink = X_Env::routeLink('megavideo', 'status');
     $this->getResponse()->setHeader('Content-Type', 'text/javascript');
     $this->_helper->layout()->disableLayout();
     $this->view->linkAll = $linkAll;
     $this->view->linkSingle = $linkSingle;
     $this->view->linkSingleCategoryRequest = $linkSingleCategoryRequest;
     $this->view->paginationRequest = $paginationRequest;
     $this->view->allpagesearchRequest = $allpagesearchRequest;
     $this->view->statusWindowLink = $statusWindowLink;
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:17,代碼來源:MegavideoController.php

示例3: getUrl

 public function getUrl()
 {
     $this->_fetch();
     if ($this->options->premium && $this->options->username != '' && $this->options->password != '') {
         // i have to check here for quality mode
         $quality = Zend_Controller_Front::getInstance()->getRequest()->getParam('megavideo:quality', 'normal');
         switch ($quality) {
             case self::QUALITY_NOPREMIUM:
                 return $this->_fetched->get('URL');
             case self::QUALITY_NORMAL:
                 return X_Env::routeLink('megavideo', 'premium', array('v' => $this->_fetched->id));
             case self::QUALITY_FULL:
             default:
                 return X_Env::routeLink('megavideo', 'premium', array('v' => $this->_fetched->id, 'q' => $quality));
         }
     } else {
         return $this->_fetched->get('URL');
     }
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:19,代碼來源:Megavideo.php

示例4: resolveLocation

 /**
  * @see X_VlcShares_Plugins_ResolverInterface::resolveLocation
  * @param string $location
  * @return string real address of a resource
  */
 function resolveLocation($location = null)
 {
     if ($location == '' || $location == null) {
         return false;
     }
     // if it isn't in the channels array it's an invalid location
     if (!array_search($location, $this->channels)) {
         return null;
     }
     // X_Env::routeLink should be deprecated, but now is the best option
     $linkUrl = X_Env::routeLink('spainradio', 'proxy', array('v' => X_Env::encode($location)));
     $return = $linkUrl;
     return $return;
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:19,代碼來源:Spainradio.php

示例5: resolveLocation

 /**
  * @see X_VlcShares_Plugins_ResolverInterface::resolveLocation
  * @param string $location
  * @return string real address of a resource
  */
 function resolveLocation($location = null)
 {
     if ($location == '' || $location == null) {
         return false;
     }
     if (array_key_exists($location, $this->cachedLocation)) {
         return $this->cachedLocation[$location];
     }
     X_Debug::i("Requested location: {$location}");
     @(list($type, $letter, $thread, $href) = explode('/', $location, 4));
     X_Debug::i("Type: {$type}, Letter: {$letter}, Thread: {$thread}, Ep: {$href}");
     if ($href == null || $thread == null || $type == null) {
         $this->cachedLocation[$location] = false;
         return false;
     }
     $return = false;
     if ($type == self::TYPE_SERIES_PERGENRE || $type == self::TYPE_SERIES_PERLETTER) {
         if ($this->helpers()->devices()->isWiimc() || $this->config('proxy.enabled', true)) {
             // X_Env::routeLink should be deprecated, but now is the best option
             $return = X_Env::routeLink('animeftw', 'proxy2', array('id' => X_Env::encode($href)));
         } else {
             // $href is the video id
             try {
                 /* @var $helper X_VlcShares_Plugins_Helper_AnimeFTW */
                 $helper = $this->helpers('animeftw');
                 $episode = $helper->getEpisode($href);
                 if (@$episode['url'] != '') {
                     $return = $episode['url'];
                 }
             } catch (Exception $e) {
             }
         }
     } else {
         // i have to fetch the streaming page :(
         $baseUrl = $this->config('base.url', self::BASE_URL);
         $baseUrl .= "{$type}/{$thread}/{$href}";
         $htmlString = $this->_loadPage($baseUrl, true);
         // <param name=\"src\" value=\"([^\"]*)\" \/>
         if (preg_match('/<param name=\\"src\\" value=\\"([^\\"]*)\\" \\/>/', $htmlString, $match)) {
             // link = match[1]
             $linkUrl = $match[1];
             if (strpos($linkUrl, 'megavideo') !== false) {
                 @(list(, $megavideoID) = explode('/v/', $linkUrl, 2));
                 X_Debug::i("Megavideo ID: {$megavideoID}");
                 try {
                     /* @var $megavideo X_VlcShares_Plugins_Helper_Megavideo */
                     $megavideo = $this->helpers('megavideo');
                     // if server isn't specified, there is no video
                     //$megavideo->setLocation($megavideoID);
                     if ($megavideo->setLocation($megavideoID)->getServer()) {
                         $return = $megavideo->getUrl();
                     }
                 } catch (Exception $e) {
                     X_Debug::e($e->getMessage());
                 }
             } else {
                 // files in videos2.animeftw.tv require a valid referer page to be watched
                 // and animeftw controller does the magic trick
                 if ($this->config('proxy.enabled', true)) {
                     // X_Env::routeLink should be deprecated, but now is the best option
                     $linkUrl = X_Env::routeLink('animeftw', 'proxy', array('v' => X_Env::encode($linkUrl), 'r' => X_Env::encode($baseUrl)));
                 }
                 $return = $linkUrl;
             }
         }
     }
     $this->cachedLocation[$location] = $return;
     return $return;
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:74,代碼來源:AnimeFTW.php


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