本文整理汇总了PHP中TbArray::removeValues方法的典型用法代码示例。如果您正苦于以下问题:PHP TbArray::removeValues方法的具体用法?PHP TbArray::removeValues怎么用?PHP TbArray::removeValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbArray
的用法示例。
在下文中一共展示了TbArray::removeValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemoveValues
public function testRemoveValues()
{
$array = array('these' => 'are', 'my' => 'values');
TbArray::removeValues(array('these', 'my'), $array);
$this->assertArrayNotHasKey('these', $array);
$this->assertArrayNotHasKey('my', $array);
}
示例2: btn
/**
* Generates a button.
* @param string $type the button type.
* @param string $label the button label text.
* @param array $htmlOptions additional HTML attributes.
* @return string the generated button.
*/
public static function btn($type, $label, $htmlOptions = array())
{
self::addCssClass('btn', $htmlOptions);
$color = TbArray::popValue('color', $htmlOptions);
if (!empty($color)) {
self::addCssClass('btn-' . $color, $htmlOptions);
}
$size = TbArray::popValue('size', $htmlOptions);
if (!empty($size)) {
self::addCssClass('btn-' . $size, $htmlOptions);
}
if (TbArray::popValue('block', $htmlOptions, false)) {
self::addCssClass('btn-block', $htmlOptions);
}
if (TbArray::popValue('disabled', $htmlOptions, false)) {
self::addCssClass('disabled', $htmlOptions);
$htmlOptions['disabled'] = 'disabled';
}
$loading = TbArray::popValue('loading', $htmlOptions);
if (!empty($loading)) {
$htmlOptions['data-loading-text'] = $loading;
}
if (TbArray::popValue('toggle', $htmlOptions, false)) {
$htmlOptions['data-toggle'] = 'button';
}
$icon = TbArray::popValue('icon', $htmlOptions);
$iconOptions = TbArray::popValue('iconOptions', $htmlOptions, array());
if (strpos($type, 'input') === false) {
if (!empty($icon)) {
$label = self::icon($icon, $iconOptions) . ' ' . $label;
}
$items = TbArray::popValue('items', $htmlOptions);
}
$dropdownOptions = $htmlOptions;
TbArray::removeValues(array('groupOptions', 'menuOptions', 'dropup'), $htmlOptions);
self::addSpanClass($htmlOptions);
// must be called here as parent renders buttons
self::addPullClass($htmlOptions);
// must be called here as parent renders buttons
return isset($items) ? self::btnDropdown($type, $label, $items, $dropdownOptions) : self::createButton($type, $label, $htmlOptions);
}