]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - vendor/oojs/oojs-ui/php/layouts/HorizontalLayout.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / oojs / oojs-ui / php / layouts / HorizontalLayout.php
1 <?php
2
3 namespace OOUI;
4
5 /**
6  * HorizontalLayout arranges its contents in a single line (using `display: inline-block` for its
7  * items), with small margins between them.
8  */
9 class HorizontalLayout extends Layout {
10         use GroupElement;
11
12         /**
13          * @param array $config Configuration options
14          * @param Widget[]|Layout[] $config['items'] Widgets or other layouts to add to the layout.
15          */
16         public function __construct( array $config = [] ) {
17                 // Parent constructor
18                 parent::__construct( $config );
19
20                 // Traits
21                 $this->initializeGroupElement( array_merge( $config, [ 'group' => $this ] ) );
22
23                 // Initialization
24                 $this->addClasses( [ 'oo-ui-horizontalLayout' ] );
25                 if ( isset( $config['items'] ) ) {
26                         $this->addItems( $config['items'] );
27                 }
28         }
29 }