本文整理匯總了PHP中GlobalConfig::getLanguages方法的典型用法代碼示例。如果您正苦於以下問題:PHP GlobalConfig::getLanguages方法的具體用法?PHP GlobalConfig::getLanguages怎麽用?PHP GlobalConfig::getLanguages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GlobalConfig
的用法示例。
在下文中一共展示了GlobalConfig::getLanguages方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GlobalConfig
return;
}
$config = new GlobalConfig();
$model = new Model($config);
$controller = new WebController($model);
$request = new Request($model);
// PATH_INFO, for example "/ysa/fi"
$path = $request->getServerConstant('PATH_INFO') ? $request->getServerConstant('PATH_INFO') : '';
$parts = explode('/', $path);
if (sizeof($parts) <= 2) {
// if language code missing, redirect to guessed language
// in any case, redirect to <lang>/
$lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage();
header("Location: " . $lang . "/");
} else {
if (array_key_exists($parts[1], $config->getLanguages())) {
// global pages
$request->setLang($parts[1]);
$content_lang = $request->getQueryParam('clang');
$request->setContentLang($content_lang);
$parts[2] == 'about' || $parts[2] == 'feedback' || $parts[2] == 'search' ? $request->setPage($parts[2]) : $request->setPage('');
if ($request->getPage() == '') {
$controller->invokeVocabularies($request);
} elseif ($request->getPage() == 'about') {
$controller->invokeAboutPage($request);
} elseif ($request->getPage() == 'feedback') {
$controller->invokeFeedbackForm($request);
} elseif ($request->getPage() == 'search') {
$controller->invokeGlobalSearch($request);
} else {
$controller->invokeGenericErrorPage($request);