summaryrefslogtreecommitdiff
path: root/vendor/oojs/oojs-ui/php/layouts/HorizontalLayout.php
blob: d4acb2166ac4e3b8123087c7047665a93c31b637 (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
<?php

namespace OOUI;

/**
 * HorizontalLayout arranges its contents in a single line (using `display: inline-block` for its
 * items), with small margins between them.
 */
class HorizontalLayout extends Layout {
	/**
	 * @param array $config Configuration options
	 * @param Widget[]|Layout[] $config['items'] Widgets or other layouts to add to the layout.
	 */
	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-horizontalLayout' ) );
		if ( isset( $config['items'] ) ) {
			$this->addItems( $config['items'] );
		}
	}
}