当前位置: 首页>>代码示例>>PHP>>正文


PHP i18n::getAvailableLanguages方法代码示例

本文整理汇总了PHP中i18n::getAvailableLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP i18n::getAvailableLanguages方法的具体用法?PHP i18n::getAvailableLanguages怎么用?PHP i18n::getAvailableLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在i18n的用法示例。


在下文中一共展示了i18n::getAvailableLanguages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     /* Setup Routine */
     $page = new RainTPL();
     $page::configure(array('cache_dir' => 'tmp/'));
     $page::$path_replace = false;
     // We escape it here because ENT_NOQUOTES can't be used in RainTPL templates.
     $page->assign('CIPHERDATA', htmlspecialchars(helper::getPaste()['data'], ENT_NOQUOTES));
     $page->assign('ERROR', self::$error);
     $page->assign('STATUS', self::$status);
     $page->assign('VERSION', self::$version);
     $page->assign('DISCUSSION', true);
     $page->assign('OPENDISCUSSION', true);
     $page->assign('MARKDOWN', true);
     $page->assign('SYNTAXHIGHLIGHTING', true);
     $page->assign('SYNTAXHIGHLIGHTINGTHEME', 'sons-of-obsidian');
     $page->assign('BURNAFTERREADINGSELECTED', false);
     $page->assign('PASSWORD', true);
     $page->assign('FILEUPLOAD', false);
     $page->assign('BASE64JSVERSION', '2.1.9');
     $page->assign('NOTICE', 'example');
     $page->assign('LANGUAGESELECTION', '');
     $page->assign('LANGUAGES', i18n::getLanguageLabels(i18n::getAvailableLanguages()));
     $page->assign('EXPIRE', self::$expire);
     $page->assign('EXPIREDEFAULT', self::$expire_default);
     $page->assign('EXPIRECLONE', true);
     ob_start();
     $page->draw('page');
     $this->_content = ob_get_contents();
     // run a second time from cache
     $page->cache('page');
     $page->draw('page');
     ob_end_clean();
 }
开发者ID:danesjenovdan,项目名称:DJNBin,代码行数:34,代码来源:RainTPL.php

示例2: _view

 /**
  * Display ZeroBin frontend.
  *
  * @access private
  * @return void
  */
 private function _view()
 {
     // set headers to disable caching
     $time = gmdate('D, d M Y H:i:s \\G\\M\\T');
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Pragma: no-cache');
     header('Expires: ' . $time);
     header('Last-Modified: ' . $time);
     header('Vary: Accept');
     // label all the expiration options
     $expire = array();
     foreach ($this->_conf->getSection('expire_options') as $time => $seconds) {
         $expire[$time] = $seconds == 0 ? i18n::_(ucfirst($time)) : filter::time_humanreadable($time);
     }
     // translate all the formatter options
     $formatters = array_map(array('i18n', 'translate'), $this->_conf->getSection('formatter_options'));
     // set language cookie if that functionality was enabled
     $languageselection = '';
     if ($this->_conf->getKey('languageselection')) {
         $languageselection = i18n::getLanguage();
         setcookie('lang', $languageselection);
     }
     $page = new RainTPL();
     $page::$path_replace = false;
     // we escape it here because ENT_NOQUOTES can't be used in RainTPL templates
     $page->assign('CIPHERDATA', htmlspecialchars($this->_data, ENT_NOQUOTES));
     $page->assign('ERROR', i18n::_($this->_error));
     $page->assign('STATUS', i18n::_($this->_status));
     $page->assign('VERSION', self::VERSION);
     $page->assign('DISCUSSION', $this->_conf->getKey('discussion'));
     $page->assign('OPENDISCUSSION', $this->_conf->getKey('opendiscussion'));
     $page->assign('MARKDOWN', array_key_exists('markdown', $formatters));
     $page->assign('SYNTAXHIGHLIGHTING', array_key_exists('syntaxhighlighting', $formatters));
     $page->assign('SYNTAXHIGHLIGHTINGTHEME', $this->_conf->getKey('syntaxhighlightingtheme'));
     $page->assign('FORMATTER', $formatters);
     $page->assign('FORMATTERDEFAULT', $this->_conf->getKey('defaultformatter'));
     $page->assign('NOTICE', i18n::_($this->_conf->getKey('notice')));
     $page->assign('BURNAFTERREADINGSELECTED', $this->_conf->getKey('burnafterreadingselected'));
     $page->assign('PASSWORD', $this->_conf->getKey('password'));
     $page->assign('FILEUPLOAD', $this->_conf->getKey('fileupload'));
     $page->assign('BASE64JSVERSION', $this->_conf->getKey('base64version'));
     $page->assign('LANGUAGESELECTION', $languageselection);
     $page->assign('LANGUAGES', i18n::getLanguageLabels(i18n::getAvailableLanguages()));
     $page->assign('EXPIRE', $expire);
     $page->assign('EXPIREDEFAULT', $this->_conf->getKey('default', 'expire'));
     $page->assign('EXPIRECLONE', !$this->_doesExpire || $this->_doesExpire && $this->_conf->getKey('clone', 'expire'));
     $page->assign('URLSHORTENER', $this->_conf->getKey('urlshortener'));
     $page->draw($this->_conf->getKey('template'));
 }
开发者ID:squarefractal,项目名称:ZeroBin,代码行数:55,代码来源:zerobin.php


注:本文中的i18n::getAvailableLanguages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。