本文整理汇总了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));
}
示例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;
}
示例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');
}
}
示例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;
}
示例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;
}