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


PHP WoW::GetUrl方法代碼示例

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


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

示例1: switch

?>
')});
//]]></script>

<?php 
echo WoW_Template::GetJSForPage();
switch (WoW_Template::GetPageIndex()) {
    case 'item':
    case 'items':
        echo sprintf('<script type="text/javascript" src="%sdata=weight-presets.zones"></script>', WoW::GetUrl());
        break;
    case 'talent':
        echo sprintf('<script type="text/javascript" src="%sdata=glyphs"></script>', WoW::GetUrl(), WoW_Locale::GetLocaleID());
        break;
    case 'npc':
        echo sprintf('<script type="text/javascript" src="%sdata=zones"></script>', WoW::GetUrl(), WoW_Locale::GetLocaleID());
        break;
    case 'search':
        echo sprintf('<script type="text/javascript" src="%sdata=realms.weight-presets"></script>', WoW::GetUrl(), WoW_Locale::GetLocaleID());
        break;
}
?>

<script type="text/javascript" src="<?php 
echo WoW::GetUrl();
?>
data=user"></script>

</head>

開發者ID:Kheros,項目名稱:wowhead,代碼行數:29,代碼來源:wowhead_block_header.php

示例2: sprintf

    if ($listView != null) {
        echo sprintf('new Listview({template: \'spell\', id: \'abilities\', name: LANG.tab_abilities, tabs: tabsRelated, parent: \'lkljbjkb574\', visibleCols: [\'schools\'], hiddenCols: [\'reagents\', \'skill\'], computeDataFunc: Listview.funcBox.initModeFilter, onAfterCreate: Listview.funcBox.addModeIndicator, data: [%s]});', $listView);
    }
}
if (is_array($npc['npcs'])) {
    $npcs_count = count($npc['npcs']);
    $current = 1;
    $listView = '';
    foreach ($npc['npcs'] as $creature) {
        $listView .= sprintf('{"classification":%d,"id":%d,"location":[%d],"maxlevel":%d,"minlevel":%d,"name":"%s","react":[-1,-1],"type":%d,skin:\'\'}', $creature['rank'], $creature['entry'], $creature['zone_info']['areaID'], $creature['minlevel'], $creature['maxlevel'], str_replace('"', '\\"', $creature['name']), $creature['type']);
        if ($current < $npcs_count) {
            $listView .= ',';
        }
        ++$current;
    }
    echo sprintf('new Listview({template: \'npc\', id: \'same-model-as\', name: LANG.tab_samemodelas, tabs: tabsRelated, parent: \'lkljbjkb574\', visibleCols: [\'skin\'], note: $WH.sprintf(LANG.lvnote_filterresults, \'%s/npcs?filter=cr=34;crs=0;crv=692\'), data: [%s]});', WoW::GetUrl(), $listView);
}
?>


//new Listview({template: 'quest', id: 'objective-of', name: LANG.tab_objectiveof, tabs: tabsRelated, parent: 'lkljbjkb574', data: [{"category":1337,"category2":2,"id":27677,"level":40,"money":20000,"name":"Archaedas, The Ancient Stone Watcher","reqlevel":35,"side":1,"type":81,"wflags":96,"xp":3250},{"category":1337,"category2":2,"id":27680,"level":40,"money":20000,"name":"Archaedas, The Ancient Stone Watcher","reqlevel":35,"side":2,"type":81,"wflags":96,"xp":3250}]});
//new Listview({template: 'quest', id: 'starts', name: LANG.tab_starts, tabs: tabsRelated, parent: 'lkljbjkb574', data: [{"category":1337,"category2":2,"id":27677,"level":40,"money":20000,"name":"Archaedas, The Ancient Stone Watcher","reqlevel":35,"side":1,"type":81,"wflags":96,"xp":3250},{"category":1337,"category2":2,"id":27680,"level":40,"money":20000,"name":"Archaedas, The Ancient Stone Watcher","reqlevel":35,"side":2,"type":81,"wflags":96,"xp":3250}]});
new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'lkljbjkb574', data: lv_comments0});
if(lv_links.length)
	new Listview({template: 'relatedlinks', id: 'links', name: LANG.tab_whatlinkshere, tabs: tabsRelated, parent: 'lkljbjkb574', data: lv_links});
new Listview({template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'lkljbjkb574', data: lv_screenshots});
if(lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
	new Listview({template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'lkljbjkb574', data: lv_videos});
tabsRelated.flush();
//]]></script>
開發者ID:Kheros,項目名稱:wowhead,代碼行數:30,代碼來源:wowhead_content_npc.php


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