本文整理汇总了PHP中language::subdomainUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP language::subdomainUrl方法的具体用法?PHP language::subdomainUrl怎么用?PHP language::subdomainUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类language
的用法示例。
在下文中一共展示了language::subdomainUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: language
//TODO homogenisation with languagelinks + do not force www + unobtrusive redirect
if (!defined('e107_INIT')) {
exit;
}
require_once e_HANDLER . 'language_class.php';
$slng = new language();
$languageList = explode(',', e_LANLIST);
sort($languageList);
if (varset($pref['multilanguage_subdomain'])) {
$action = e_QUERY ? e_SELF . '?' . e_QUERY : e_SELF;
$text = '
<div style="text-align:center">
<select class="tbox form-control" name="lang_select" style="width:95%" onchange="location.href=this.options[selectedIndex].value">';
foreach ($languageList as $languageFolder) {
$selected = $languageFolder == e_LANGUAGE ? ' selected="selected"' : '';
$urlval = $slng->subdomainUrl($languageFolder);
$text .= '
<option value="' . $urlval . '"' . $selected . '>' . $languageFolder . '</option>';
}
$text .= '
</select>
</div>';
} else {
//FIXME may not work with session
$action = e_QUERY && !$_GET['elan'] ? e_SELF . '?' . e_QUERY : e_SELF;
$text = '
<form method="post" action="' . $action . '">
<div class="center">
<select name="sitelanguage" class="tbox form-control">';
foreach ($languageList as $languageFolder) {
$selected = $languageFolder == e_LANGUAGE ? ' selected="selected"' : '';