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


PHP Lang::clear方法代码示例

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


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

示例1: load

 /**
  * Load specified language file
  */
 public static function load($path, $lang, $clear = false)
 {
     if ((bool) $clear === true || !self::$_dictionary instanceof Dictionary) {
         Lang::clear();
     }
     $include = sprintf($path, $lang);
     if (file_exists($include)) {
         require $include;
     }
     if (isset($dictionary) && is_array($dictionary)) {
         self::$_dictionary->merge($dictionary);
     }
     if (isset($transliterations) && is_array($transliterations)) {
         self::$_transliterations = array_merge(self::$_transliterations, $transliterations);
     }
     if (empty(self::$_transliterations)) {
         include TOOLKIT . '/include.transliterations.php';
         self::$_transliterations = $transliterations;
     }
 }
开发者ID:klaftertief,项目名称:sym-forum,代码行数:23,代码来源:class.lang.php

示例2: reloadLangFromAuthorPreference

 public function reloadLangFromAuthorPreference()
 {
     $lang = $this->Author->get('language');
     if ($lang && $lang != self::lang()) {
         self::$_lang = $lang;
         if ($lang != 'en') {
             Lang::loadAll($this->ExtensionManager);
         } else {
             // As there is no English dictionary the default dictionary needs to be cleared
             Lang::clear();
         }
     }
 }
开发者ID:bauhouse,项目名称:sym-forum,代码行数:13,代码来源:class.symphony.php

示例3: load

 /**
  * Load specified language file
  */
 public static function load($path, $lang, $clear = false)
 {
     if ((bool) $clear === true || !self::$_dictionary instanceof Dictionary) {
         Lang::clear();
     }
     $include = sprintf($path, $lang);
     if (is_file($include)) {
         require $include;
     }
     if (isset($dictionary) && is_array($dictionary)) {
         self::$_dictionary->merge($dictionary);
     }
     if (isset($characters) && is_array($characters)) {
         self::$_transliterations_character_replacements = array_merge(self::$_transliterations_character_replacements, $characters);
     }
     if (isset($patterns) && is_array($patterns)) {
         self::$_transliterations_pattern_replacements = array_merge(self::$_transliterations_pattern_replacements, $patterns);
     }
     /*
     			if(empty(self::$_transliterations_character_replacements)) {
     				include(LIB . '/include.transliterations.php');
     				self::$_transliterations_character_replacements = $characters;
     			}
     
     			if(empty(self::$_transliterations_pattern_replacements)) {
     				include(LIB . '/include.transliterations.php');
     				self::$_transliterations_pattern_replacements = $patterns;
     			}
     */
 }
开发者ID:symphonycms,项目名称:symphony-3,代码行数:33,代码来源:class.lang.php

示例4: reloadLangFromUserPreference

 public function reloadLangFromUserPreference()
 {
     $lang = $this->User->language;
     if ($lang && $lang != self::lang()) {
         self::$_lang = $lang;
         if ($lang != 'en') {
             Lang::loadAll();
         } else {
             // As there is no English dictionary the default dictionary needs to be cleared
             Lang::clear();
         }
     }
 }
开发者ID:pointybeard,项目名称:symphony-3,代码行数:13,代码来源:class.symphony.php


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