本文整理汇总了PHP中Translator::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::get方法的具体用法?PHP Translator::get怎么用?PHP Translator::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translator
的用法示例。
在下文中一共展示了Translator::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormHtml
public function getFormHtml()
{
?>
<fieldset>
<legend><?php
echo Translator::get('module_config');
?>
</legend>
<div class="form-fields">
<?php
$this->addInputText('config[charset]', Translator::get('module_default_charset'), $this->config->get('charset'))->addInputText('config[language]', Translator::get('module_default_language'), $this->config->get('language'))->addInputText('config[locale]', Translator::get('module_default_locale'), $this->config->get('locale'))->addInputText('config[module]', Translator::get('module_default_module'), $this->config->get('module'))->addInputText('config[action]', Translator::get('module_default_action'), $this->config->get('action'));
?>
</div>
</fieldset>
<?php
foreach ($this->envs as $env) {
?>
<fieldset>
<legend><?php
echo Translator::get('module_config_' . $env);
?>
</legend>
<div class="form-fields">
<?php
$this->addInputText('config[' . $env . '][http_host]', Translator::get('module_http_host'), $this->config->getEnvKey($env, 'http_host'))->addInputText('config[' . $env . '][contact]', Translator::get('module_contact'), $this->config->getEnvKey($env, 'contact'))->addInputText('config[' . $env . '][host]', Translator::get('module_database_host'), $this->config->getEnvKey($env, 'host'))->addInputText('config[' . $env . '][database]', Translator::get('module_database_database'), $this->config->getEnvKey($env, 'database'))->addInputText('config[' . $env . '][user]', Translator::get('module_database_user'), $this->config->getEnvKey($env, 'user'))->addInputText('config[' . $env . '][password]', Translator::get('module_database_password'), $this->config->getEnvKey($env, 'password'));
?>
</div>
</fieldset>
<?php
}
?>
<?php
}
示例2: get404
public function get404()
{
$view = $this->getView('Errors::404');
$layout = $this->getLayout('Default', $view);
$layout->addBodyClass('error');
$layout->addArianne(new Link(Translator::get('module_' . $this->response->request->module), UrlFactory::backTo($this->response->request->module)));
$layout->addArianne(new Link('404'));
}
示例3: renderHtml
public function renderHtml()
{
?>
<h1>404</h1>
<p><?php
echo Translator::get('module_error404_text');
?>
</p>
<?php
}
示例4: updateAction
public function updateAction()
{
if (empty($_GET['id']) || !($language = DBFactory::get($this->module)->get($_GET['id'])) instanceof Language) {
Header::location(UrlFactory::module($this->module));
}
$this->valid($language, $_POST);
$view = $this->getView('Form');
$view->language = $language;
$layout = $this->getLayout('Default', $view);
$layout->addBreadcrumbsLink(new Link(Translator::get('module_languages'), UrlFactory::module($this->module)));
$layout->addBreadcrumbsLink(new Link($language->name, UrlFactory::update($this->module, $language)));
$layout->addBreadcrumbsLink(new Link(Translator::get('module_update')));
}
示例5: getFormHtml
public function getFormHtml()
{
?>
<fieldset>
<legend><?php
echo Translator::get('module_language');
?>
</legend>
<?php
$this->addCheckbox('enabled', Translator::get('module_enabled'), $this->language->enabled)->addInputText('name', Translator::get('module_name'), $this->language->name)->addInputText('code', Translator::get('module_code'), $this->language->code)->addInputText('locale', Translator::get('module_locale'), $this->language->locale);
?>
</fieldset>
<?php
}
示例6: updateAction
public function updateAction()
{
if (empty($_GET['id']) || !($admin = DBFactory::get($this->module)->get($_GET['id'])) instanceof Admin) {
$this->response->location = UrlFactory::module($this->module);
$this->response->status = Status::$NotFound;
}
$this->valid($admin, $_POST);
$view = $this->getView('Form');
$view->admin = $admin;
$view->languages = DBFactory::get('languages')->getEnabled();
$layout = $this->getLayout('Default', $view);
$layout->addBreadcrumbsLink(new Link(Translator::get('module_admins'), UrlFactory::module($this->module)));
$layout->addBreadcrumbsLink(new Link($admin->login, UrlFactory::update($this->module, $admin)));
$layout->addBreadcrumbsLink(new Link(Translator::get('module_update')));
}
示例7: getFormHtml
public function getFormHtml()
{
?>
<fieldset>
<legend><?php
echo Translator::get('module_translation');
?>
</legend>
<?php
$this->addInputText('variable', Translator::get('module_variable'), $this->translation->variable);
foreach ($this->languages as $language) {
$this->addInputText('languages[' . $language->code . ']', $language->displayFlag(), $this->translation->get($language));
}
?>
</fieldset>
<?php
}
示例8: updateAction
public function updateAction()
{
if (empty($_GET['id']) || !($translation = DBFactory::get($this->module)->get($_GET['id'])) instanceof Translation) {
Header::location(UrlFactory::module($this->module));
}
$this->valid($translation, $_POST);
if (!empty($_POST)) {
$this->generate();
}
$view = $this->getView('Form');
$view->translation = $translation;
$view->languages = DBFactory::get('languages')->getEnabled();
$layout = $this->getLayout('Default', $view);
$layout->addBreadcrumbsLink(new Link(Translator::get('module_translations'), UrlFactory::module($this->module)));
$layout->addBreadcrumbsLink(new Link($translation->variable, UrlFactory::update($this->module, $translation)));
$layout->addBreadcrumbsLink(new Link(Translator::get('module_update')));
}
示例9: addDeleteButton
protected function addDeleteButton($object, $class = 'delete', $url = null, $module = null)
{
$module = is_null($module) ? $this->module : $module;
$url = is_null($url) ? UrlFactory::delete($module, $object) : $url;
?>
--><a class="icon-delete <?php
echo $class;
?>
" href="<?php
echo $url;
?>
" data-delete-message="<?php
echo Translator::get('module_delete_message') . ' ' . $object->getNameForDeleteMessage();
?>
?"></a><!--
<?php
return $this;
}
示例10: getHeader
protected function getHeader()
{
?>
<th class="action-n2"></th>
<th class="number"><?php
echo Translator::get('module_order');
?>
</th>
<th class="number"><?php
echo Translator::get('module_enabled');
?>
</th>
<th><?php
echo Translator::get('module_name');
?>
</th>
<?php
}
示例11: indexAction
public function indexAction()
{
if (!empty($_POST['config'])) {
$tab = array();
$export = array();
$content = '<?php' . "\n";
ob_start();
var_export($_POST['config']);
$tab = ob_get_contents();
ob_end_clean();
$content .= '$config = ' . $tab . ';';
file_put_contents(ROOT . 'config.inc.php', $content);
}
$view = $this->getView('Form');
$view->config = new Config();
$layout = $this->getLayout('Default', $view);
$layout->addBreadcrumbsLink(new Link(Translator::get('module_configs'), UrlFactory::module($this->module)));
$layout->addBreadcrumbsLink(new Link(Translator::get('module_config')));
}
示例12: getFormHtml
public function getFormHtml()
{
$options = array();
foreach ($this->languages as $language) {
$options[$language->id] = $language->name;
}
?>
<fieldset>
<legend><?php
echo Translator::get('module_admin');
?>
</legend>
<div class="form-fields">
<?php
$this->addCheckbox('heurisko', Translator::get('module_login'), $this->admin->isHeurisko())->addInputText('first_name', Translator::get('module_first_name'), $this->admin->first_name)->addInputText('last_name', Translator::get('module_last_name'), $this->admin->last_name)->addInputText('email', Translator::get('module_email'), $this->admin->email)->addInputText('login', Translator::get('module_login'), $this->admin->login)->addInputText('password', Translator::get('module_password'), $this->admin->getPassword())->addSelect('language', Translator::get('module_language'), $options, $this->admin->getLanguageId());
?>
</div>
</fieldset>
<?php
}
示例13: getHeader
protected function getHeader()
{
?>
<th class="action-n2"></th>
<th class="number">Heurisko</th>
<th><?php
echo Translator::get('module_login');
?>
</th>
<th><?php
echo Translator::get('module_last_name');
?>
</th>
<th><?php
echo Translator::get('module_first_name');
?>
</th>
<th><?php
echo Translator::get('module_email');
?>
</th>
<?php
}
示例14: renderHtml
public function renderHtml()
{
?>
<form method="post" action="" class="backoffice-crud">
<?php
$this->getFormHtml();
?>
<div class="backoffice-valid">
<input type="hidden" name="referer" value="<?php
echo UrlFactory::backTo($this->module);
?>
" />
<button type="submit"><?php
echo Translator::get('module_submit');
?>
</button>
<button type="reset"><?php
echo Translator::get('module_reset');
?>
</button>
</div>
</form>
<?php
}
示例15:
<div class="content">
<h1 class="title"><?php
echo Translator::get('pages.faq.freq_asked_que');
?>
</h1>
<?php
if ($empty) {
?>
<h3 class="title"><?php
echo Translator::get('pages.faq.no_question');
?>
</h3>
<?php
}
foreach ($faqs as $k => $faq) {
?>
<h3 class="title"><?php
echo $faq->ask;
?>
</h3>
<p><?php
echo $faq->answer;
?>
</p>
<?php
}
?>
</div>