summaryrefslogtreecommitdiff
path: root/vendor/oojs/oojs-ui/php/widgets/ButtonGroupWidget.php
blob: 79d3aaa131fde421d077eb4b94762c7ea01d31bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

namespace OOUI;

/**
 * Group widget for multiple related buttons.
 *
 * Use together with ButtonWidget.
 */
class ButtonGroupWidget extends Widget {
	/**
	 * @param array $config Configuration options
	 * @param ButtonWidget[] $config['items'] Buttons to add
	 */
	public function __construct( array $config = array() ) {
		// Parent constructor
		parent::__construct( $config );

		// Mixins
		$this->mixin( new GroupElement( $this, array_merge( $config, array( 'group' => $this ) ) ) );

		// Initialization
		$this->addClasses( array( 'oo-ui-buttonGroupWidget' ) );
		if ( isset( $config['items'] ) ) {
			$this->addItems( $config['items'] );
		}
	}
}