本文整理匯總了PHP中TbArray::copyValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP TbArray::copyValues方法的具體用法?PHP TbArray::copyValues怎麽用?PHP TbArray::copyValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TbArray
的用法示例。
在下文中一共展示了TbArray::copyValues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCopyValues
public function testCopyValues()
{
$a = array('key' => 'value');
$b = array();
$array = TbArray::copyValues(array('key'), $a, $b);
$this->assertEquals($a, $array);
$a = array('key' => 'value');
$b = array('key' => 'other');
$array = TbArray::copyValues(array('key'), $a, $b, true);
$this->assertEquals($a, $array);
}
示例2: buttonToolbar
/**
* Generates a button toolbar.
* @param array $groups the button group configurations.
* @param array $htmlOptions additional HTML options.
* @return string the generated button toolbar.
*/
public static function buttonToolbar(array $groups, $htmlOptions = array())
{
if (!empty($groups)) {
self::addCssClass('btn-toolbar', $htmlOptions);
$parentOptions = array('color' => TbArray::popValue('color', $htmlOptions), 'size' => TbArray::popValue('size', $htmlOptions), 'disabled' => TbArray::popValue('disabled', $htmlOptions));
$output = self::openTag('div', $htmlOptions);
foreach ($groups as $groupOptions) {
if (isset($groupOptions['visible']) && $groupOptions['visible'] === false) {
continue;
}
$items = TbArray::popValue('items', $groupOptions, array());
if (empty($items)) {
continue;
}
// todo: consider removing the support for htmlOptions.
$options = TbArray::popValue('htmlOptions', $groupOptions, array());
if (!empty($options)) {
$groupOptions = TbArray::merge($options, $groupOptions);
}
$groupOptions = TbArray::copyValues(array('color', 'size', 'disabled'), $parentOptions, $groupOptions);
$output .= self::buttonGroup($items, $groupOptions);
}
$output .= '</div>';
return $output;
}
return '';
}