本文整理汇总了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);
}
示例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'));
}
示例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);
}
示例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());
}