本文整理汇总了PHP中app::lang方法的典型用法代码示例。如果您正苦于以下问题:PHP app::lang方法的具体用法?PHP app::lang怎么用?PHP app::lang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::lang方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<h3><?php
echo app::lang('step6_title');
?>
</h3>
<p style="text-align:center">
<?php
echo app::lang('step6_txt1');
?>
<br><br>
<a href="/index.php"><?php
echo app::lang('step6_txt2');
?>
</a>
</p>
示例2:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<title><?php
echo app::lang('title');
?>
</title>
<link rel="stylesheet" href="/install/style.css" type="text/css">
<script src="/libc/jquery/jquery.js" type="text/javascript"></script>
</head>
<body>
<div id="page">
<div id="header">
<img src="/image.php?m=core&p=original&f=des/logo.jpg">
<div id="page_title"><?php
echo app::lang('title');
?>
</div>
</div>
<div id="content">
<?php
echo app::getVar('content');
?>
</div>
</div>
</body>
</html>
示例3: foreach
<?php
foreach ($f as $key => $arr) {
echo '<div ' . ($arr['error'] ? 'class="no"' : '') . '
<td>' . $arr[$arr['error'] ? 'error' : 'label'] . (($arr['download'] and $arr['error']) ? '. <a href="' . $arr['download'] . '">' . app::lang('download') . '</a>' : '') . '
</td>
</div>';
}
?>
</div>
<p style="margin-bottom:20px;<?php
echo $hasErrors ? 'color:red;' : '';
?>
">
<?php
echo app::lang('step2_txt' . ($hasErrors ? '2' : '1'));
?>
</p>
<form action="/install/<?php
echo $hasErrors ? '2' : '3';
?>
" class="data-form" method="post">
<div class="submit">
<input type="submit" value="<?php
echo app::lang($hasErrors ? 'refresh' : 'next');
?>
" class="button">
</div>
</form>
示例4: foreach
4. <?php
echo app::lang('step4_title');
?>
</h4>
<form action="/install/4" class="data-form" method="post">
<div class="required_global"><?php
echo app::lang('required_global');
?>
</div>
<?php
foreach ($f as $key => $arr) {
echo '<div class="row' . ($arr['error'] ? ' error' : '') . '">
<label>
<input type="text" name="' . $key . '" value="' . $arr['value'] . '" style="width:300px;">
<span class="title">' . $arr['label'] . ($arr['required'] ? '<span class="required">*</span>' : '') . ':</span>
</label>
<span class="msg">' . $arr['error'] . '</span>
</div>';
}
?>
<div class="submit" style="margin-top:20px;">
<input type="submit" value="<?php
echo app::lang('next');
?>
" class="button">
</div>
</form>
示例5: empty
?>
<form action="/install/5" class="data-form" method="post">
<input type="hidden" name="install" value="<?php
echo empty($error) ? 'start' : 'restart';
?>
">
<div id="pre_install">
<p><?php
echo empty($error) ? app::lang('step5_txt1') : '';
?>
</p>
<input type="submit" value="<?php
echo app::lang((!empty($error) ? 're' : '') . 'start');
?>
" class="button" onclick="
$('#error_install').hide(0);
$('#pre_install').hide(0);
$('#post_install').show(0);
return true;">
</div>
</form>
<div id="post_install">
<?php
echo app::lang('installation');
?>
<img src="/install/img/i.gif">
</div>
示例6:
<h3><?php
echo app::lang('start_greeting');
?>
</h3>
<p><?php
echo app::lang('start_txt1');
?>
</p>
<ul id="select_language">
<li>
<form action="/install/" class="data-form" method="post">
<input type="hidden" name="lang" value="ru">
<button type="submit"><img src="/image.php?m=core&p=language_medium&f=lang/2_lng7f263f544635e3cd184fb6fac223781c.gif" alt=""> Русский</button>
</form>
</li>
<li>
<form action="/install/" class="data-form" method="post">
<input type="hidden" name="lang" value="ukr">
<button type="submit"><img src="/image.php?m=core&p=language_medium&f=lang/29_lng6f47df546e1ecd5245fde4d9e28193e0.gif" alt=""> Український</button>
</form>
</li>
<li>
<form action="/install/" class="data-form" method="post">
<input type="hidden" name="lang" value="en">
<button type="submit"><img src="/image.php?m=core&p=language_medium&f=lang/29_lng6f47df546e1ecd5245fde4d9e28193e2.gif" alt=""> English</button>
</form>
</li>
<li>
<form action="/install/" class="data-form" method="post">
示例7:
<input type="text" name="' . $key . '" value="' . $arr['value'] . '" style="width:300px;">
<span class="title">' . $arr['label'] . ($arr['required'] ? '<span class="required">*</span>' : '') . ':</span>
</label>
<span class="msg">' . $arr['error'] . '</span>
</div>';
}
?>
<div class="submit" style="margin-top:20px;">
<span style="display:none;" id="next_value"><?php
echo app::lang('next');
?>
</span>
<img src="/install/img/ajax.gif" alt="<?php
echo app::lang('server_response');
?>
" style="margin-right:5px;display:none;" align="bottom" id="ajax_indication">
<span style="margin-right:5px;color:red;display:none;" id="error_msg"></span>
<span style="margin-right:5px;color:green;display:none;" id="success_msg"><?php
echo app::lang('test_successful');
?>
</span>
<input type="submit" value="<?php
echo app::lang('test_connection');
?>
" class="button test_connect">
</div>
</form>
<script src="/install/testConnect.js" type="text/javascript"></script>
示例8: determineLocale
/**
* Detetermine Locale from current HTTP request
*/
protected function determineLocale()
{
if (isset($_COOKIE['locale']) && isset(self::$locales[$_COOKIE['locale']])) {
$this->locale = $_COOKIE['locale'];
} else {
$this->locale = app::$config['localization']['default_language'];
}
setlocale(LC_ALL, $this->locale);
date_default_timezone_set(app::$config['localization']['timezone']);
$pathCache = 'var/cache/' . $this->locale . '-lang';
$lang = '';
if (is_file($pathCache . '.php')) {
include $pathCache . '.php';
} else {
foreach (app::$activeModules as $moduleName => $type) {
if (is_file('modules/' . $moduleName . '/locale/' . $this->locale . '.php')) {
include 'modules/' . $moduleName . '/locale/' . $this->locale . '.php';
}
}
$config = new \config($pathCache . '.php', TRUE);
$config->setVariable('lang');
$config->saveConfig($lang);
\tools::file_put_contents($pathCache . '.js', substr($config->getContent(), 5, false));
}
app::$lang = $lang;
}