本文整理汇总了PHP中ResourceLoader::makeCustomURL方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceLoader::makeCustomURL方法的具体用法?PHP ResourceLoader::makeCustomURL怎么用?PHP ResourceLoader::makeCustomURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceLoader
的用法示例。
在下文中一共展示了ResourceLoader::makeCustomURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContext
public function getContext(Title $title, $skinName)
{
$wrapper = new GlobalStateWrapper(['wgTitle' => $title]);
$wg = F::app()->wg;
return $wrapper->wrap(function () use($title, $wg, $skinName) {
$wikiFactoryHub = WikiFactoryHub::getInstance();
$hubService = new HubService();
$adPageTypeService = new AdEngine2PageTypeService();
$wikiaPageType = new WikiaPageType();
$sevenOneMediaCombinedUrl = null;
if (!empty($wg->AdDriverUseSevenOneMedia)) {
// TODO: implicitly gets the skin from the context!
$sevenOneMediaCombinedUrl = ResourceLoader::makeCustomURL($wg->Out, ['wikia.ext.adengine.sevenonemedia'], 'scripts');
}
$monetizationServiceAds = null;
if (!empty($wg->AdDriverUseMonetizationService) && !empty($wg->EnableMonetizationModuleExt)) {
$monetizationServiceAds = F::app()->sendRequest('MonetizationModule', 'index')->getData()['data'];
}
$langCode = $title->getPageLanguage()->getCode();
return ['opts' => $this->filterOutEmptyItems(['adsInContent' => $wg->EnableAdsInContent, 'delayBtf' => $wg->AdDriverDelayBelowTheFold, 'enableAdsInMaps' => $wg->AdDriverEnableAdsInMaps, 'pageType' => $adPageTypeService->getPageType(), 'paidAssetDropConfig' => $wg->PaidAssetDropConfig, 'showAds' => $adPageTypeService->areAdsShowableOnPage(), 'trackSlotState' => $wg->AdDriverTrackState, 'usePostScribe' => $wg->Request->getBool('usepostscribe', false)]), 'targeting' => $this->filterOutEmptyItems(['enablePageCategories' => array_search($langCode, $wg->AdPageLevelCategoryLangs) !== false, 'pageArticleId' => $title->getArticleId(), 'pageIsArticle' => !!$title->getArticleId(), 'pageIsHub' => $wikiaPageType->isWikiaHub(), 'pageName' => $title->getPrefixedDBKey(), 'pageType' => $wikiaPageType->getPageType(), 'sevenOneMediaSub2Site' => $wg->AdDriverSevenOneMediaOverrideSub2Site, 'skin' => $skinName, 'wikiCategory' => $wikiFactoryHub->getCategoryShort($wg->CityId), 'wikiCustomKeyValues' => $wg->DartCustomKeyValues, 'wikiDbName' => $wg->DBname, 'wikiDirectedAtChildren' => $wg->WikiDirectedAtChildrenByFounder || $wg->WikiDirectedAtChildrenByStaff, 'wikiIsCorporate' => $wikiaPageType->isCorporatePage(), 'wikiIsTop1000' => $wg->AdDriverWikiIsTop1000, 'wikiLanguage' => $langCode, 'wikiVertical' => $hubService->getCategoryInfoForCity($wg->CityId)->cat_name]), 'providers' => $this->filterOutEmptyItems(['monetizationService' => $wg->AdDriverUseMonetizationService, 'monetizationServiceAds' => $monetizationServiceAds, 'sevenOneMedia' => $wg->AdDriverUseSevenOneMedia, 'sevenOneMediaCombinedUrl' => $sevenOneMediaCombinedUrl, 'taboola' => $wg->AdDriverUseTaboola]), 'slots' => $this->filterOutEmptyItems(['exitstitial' => $wg->EnableOutboundScreenExt, 'exitstitialRedirectDelay' => $wg->OutboundScreenRedirectDelay, 'invisibleHighImpact' => $wg->AdDriverEnableInvisibleHighImpactSlot]), 'forcedProvider' => $wg->AdDriverForcedProvider];
});
}
示例2: makeCustomLink
/**
* Build a script tag to load.php URL using OutputPage instance to get most of the required information
*
* @param OutputPage $out
* @param string|array $modules Module names
* @param string $only
* @param bool|string $user User name (true to get it from OutputPage)
* @param string $version
* @param array $extraQuery
* @return string
*/
public static function makeCustomLink(OutputPage $out, $modules, $only = ResourceLoaderModule::TYPE_COMBINED, $user = false, $version = null, $extraQuery = array())
{
$url = ResourceLoader::makeCustomURL($out, $modules, $only, $user, $version, $extraQuery);
if ($only === ResourceLoaderModule::TYPE_STYLES) {
$link = Html::linkedStyle($url);
} else {
$link = Html::linkedScript($url);
}
return $link;
}