本文整理匯總了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"' : '';