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


PHP AgaviToolkit::getValueByKeyList方法代码示例

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


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

示例1: localeChanged

 /**
  * This method gets called by the translation manager when the default locale
  * has been changed.
  *
  * @param      string The new default locale.
  *
  * @author     Dominik del Bondio <ddb@bitxtender.com>
  * @author     David Zülke <dz@bitxtender.com>
  * @since      0.11.0
  */
 public function localeChanged($newLocale)
 {
     $this->locale = $newLocale;
     $this->groupingSeparator = $this->locale->getNumberSymbolGroup();
     $this->decimalSeparator = $this->locale->getNumberSymbolDecimal();
     $format = $this->locale->getCurrencyFormat('__default');
     if (is_array($this->customFormat)) {
         $format = AgaviToolkit::getValueByKeyList($this->customFormat, AgaviLocale::getLookupPath($this->locale->getIdentifier()), $format);
     } elseif ($this->customFormat) {
         $format = $this->customFormat;
     }
     $this->setFormat($format);
 }
开发者ID:horros,项目名称:agavi,代码行数:23,代码来源:AgaviCurrencyFormatter.class.php

示例2: testGetValueByKeyList

 public function testGetValueByKeyList()
 {
     $array = array('one' => 'edno', 'two' => 'dve', 'three' => 'tri', 'four' => 'chetiri');
     $keys = array('one', 'two', 'three');
     $this->assertEquals('edno', AgaviToolkit::getValueByKeyList($array, $keys));
     $this->assertEquals('dve', AgaviToolkit::getValueByKeyList($array, array('two')));
     $this->assertEquals('dve', AgaviToolkit::getValueByKeyList($array, array('two'), 'default'));
     $this->assertEquals(NULL, AgaviToolkit::getValueByKeyList($array, array('five')));
     $this->assertEquals('pet', AgaviToolkit::getValueByKeyList($array, array('five'), 'pet'));
 }
开发者ID:horros,项目名称:agavi,代码行数:10,代码来源:AgaviToolkitTest.php

示例3: localeChanged

 /**
  * This method gets called by the translation manager when the default locale
  * has been changed.
  *
  * @param      string The new default locale.
  *
  * @author     Dominik del Bondio <ddb@bitxtender.com>
  * @author     David Zülke <dz@bitxtender.com>
  * @since      0.11.0
  */
 public function localeChanged($newLocale)
 {
     $this->locale = $newLocale;
     $format = null;
     // ze default
     if (is_array($this->customFormat)) {
         $format = AgaviToolkit::getValueByKeyList($this->customFormat, AgaviLocale::getLookupPath($this->locale->getIdentifier()));
     } elseif ($this->customFormat && !$this->translationDomain) {
         $format = $this->customFormat;
     }
     if ($format === null || $this->isDateSpecifier($format)) {
         $format = $this->resolveSpecifier($this->locale, $format, $this->type);
     }
     $this->setFormat($format);
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:25,代码来源:AgaviDateFormatter.class.php

示例4: localeChanged

 /**
  * This method gets called by the translation manager when the default locale
  * has been changed.
  *
  * @param      AgaviLocale The new default locale.
  *
  * @author     David Zülke <dz@bitxtender.com>
  * @since      0.11.0
  */
 public function localeChanged($newLocale)
 {
     $this->locale = $newLocale;
     $this->currentData = AgaviToolkit::getValueByKeyList($this->domainData, AgaviLocale::getLookupPath($this->locale->getIdentifier()), array());
 }
开发者ID:horros,项目名称:agavi,代码行数:14,代码来源:AgaviSimpleTranslator.class.php


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