本文整理汇总了PHP中ArrayUtil::getNestedValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtil::getNestedValue方法的具体用法?PHP ArrayUtil::getNestedValue怎么用?PHP ArrayUtil::getNestedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil::getNestedValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($name)
{
if (strpos($name, '[')) {
$basePropertyName = substr($name, 0, strpos($name, '['));
$index = substr($name, strpos($name, '[') + 1);
if (property_exists($this, $basePropertyName)) {
return ArrayUtil::getNestedValue($this->{$basePropertyName}, $index);
}
}
return parent::__get($name);
}
示例2: renderControlContentNonEditable
protected function renderControlContentNonEditable()
{
$src = $this->resolveDividerImageUrl();
$alt = static::resolveLabel();
$imageOptions = array();
$imageHeight = ArrayUtil::getNestedValue($this->properties, "frontend['inlineStyles']['border-top-width']");
if (isset($imageHeight)) {
// get rid of px as for border-top-width we have to save it with px(it appears in style property).
$imageHeight = substr($imageHeight, 0, -2);
$imageOptions = array('height' => $imageHeight);
}
$content = ZurmoHtml::image($src, $alt, $imageOptions);
return $content;
}
示例3: resolveColumnCssClassesByRowConfiguration
protected function resolveColumnCssClassesByRowConfiguration()
{
$configuration = ArrayUtil::getNestedValue($this->properties, "backend['configuration']");
if (!isset($configuration)) {
return array();
}
$columnCssClasses = null;
$columnKeysAndCssClasses = null;
$columnKeys = array_keys($this->content);
if (strpos($configuration, ':') == false) {
$columnCount = intval($configuration);
$columnWidth = NumberToWordsUtil::convert(static::MAX_COLUMN_WIDTH / $columnCount);
$columnCssClasses = array(BuilderColumnElement::TABLE_CSS_CLASSES_PARAM_KEY => $columnWidth);
$columnCssClasses = array_fill(0, count($columnKeys), $columnCssClasses);
} else {
$ratios = explode(':', $configuration);
$total = array_sum($ratios);
$unitRatioWidth = static::MAX_COLUMN_WIDTH / $total;
foreach ($ratios as $ratio) {
$width = NumberToWordsUtil::convert($ratio * $unitRatioWidth);
$columnCssClasses[] = array(BuilderColumnElement::TABLE_CSS_CLASSES_PARAM_KEY => $width);
}
}
$columnKeysAndCssClasses = array_combine($columnKeys, $columnCssClasses);
return $columnKeysAndCssClasses;
}
示例4: resolveNonEditableWrapperHtmlOptions
protected function resolveNonEditableWrapperHtmlOptions()
{
$htmlOptions = parent::resolveNonEditableWrapperHtmlOptions();
$htmlOptions['class'] .= ' ' . $this->properties['backend']['sizeClass'];
$htmlOptions['align'] = ArrayUtil::getArrayValue($this->properties['backend'], 'align');
$width = ArrayUtil::getNestedValue($this->properties, "backend['width']");
if ($width) {
$htmlOptions['width'] = $width;
}
return $htmlOptions;
}
示例5: resolveInlineStylesForBorderDirectionNegationFromBackendPropertiesNonEditable
protected function resolveInlineStylesForBorderDirectionNegationFromBackendPropertiesNonEditable(array &$mergedProperties)
{
$borderNegationStyles = ArrayUtil::getNestedValue($this->properties, 'backend[border-negation]');
if (!empty($borderNegationStyles)) {
$borderNegationKeys = array_keys($borderNegationStyles, 'none');
foreach ($borderNegationKeys as $borderNegationKey) {
$mergedProperties['style'] .= "{$borderNegationKey}:none;";
}
}
}