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


PHP Language::getMessages方法代码示例

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


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

示例1: getMessages

 /**
  * Get the messages
  *
  * @deprecated
  *
  * @return array
  */
 public static function getMessages()
 {
     trigger_error('Backend\\Core\\Engine\\Language is deprecated.
          It has been moved to Backend\\Core\\Language\\Language', E_USER_DEPRECATED);
     return parent::getMessages();
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:13,代码来源:Language.php

示例2: parseLabels

 /**
  * Assign the labels
  */
 private function parseLabels()
 {
     // grab the current module
     $currentModule = BL::getCurrentModule();
     $errors = BL::getErrors();
     $labels = BL::getLabels();
     $messages = BL::getMessages();
     // set the begin state
     $realErrors = $errors['Core'];
     $realLabels = $labels['Core'];
     $realMessages = $messages['Core'];
     // loop all errors, label, messages and add them again, but prefixed with Core. So we can decide in the
     // template to use the Core-value instead of the one set by the module
     foreach ($errors['Core'] as $key => $value) {
         $realErrors['Core' . $key] = $value;
     }
     foreach ($labels['Core'] as $key => $value) {
         $realLabels['Core' . $key] = $value;
     }
     foreach ($messages['Core'] as $key => $value) {
         $realMessages['Core' . $key] = $value;
     }
     // are there errors for the current module?
     if (isset($errors[$currentModule])) {
         // loop the module-specific errors and reset them in the array with values we will use
         foreach ($errors[$currentModule] as $key => $value) {
             $realErrors[$key] = $value;
         }
     }
     // are there labels for the current module?
     if (isset($labels[$currentModule])) {
         // loop the module-specific labels and reset them in the array with values we will use
         foreach ($labels[$currentModule] as $key => $value) {
             $realLabels[$key] = $value;
         }
     }
     // are there messages for the current module?
     if (isset($messages[$currentModule])) {
         // loop the module-specific errors and reset them in the array with values we will use
         foreach ($messages[$currentModule] as $key => $value) {
             $realMessages[$key] = $value;
         }
     }
     // execute addslashes on the values for the locale, will be used in JS
     if ($this->addSlashes) {
         foreach ($realErrors as &$value) {
             $value = addslashes($value);
         }
         foreach ($realLabels as &$value) {
             $value = addslashes($value);
         }
         foreach ($realMessages as &$value) {
             $value = addslashes($value);
         }
     }
     // sort the arrays (just to make it look beautiful)
     ksort($realErrors);
     ksort($realLabels);
     ksort($realMessages);
     // assign errors
     $this->assignArray($realErrors, 'err');
     // assign labels
     $this->assignArray($realLabels, 'lbl');
     // assign messages
     $this->assignArray($realMessages, 'msg');
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:69,代码来源:TwigTemplate.php


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