本文整理匯總了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;";
}
}
}