| 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 |
* - 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( [ 'group' => $this ], $config ) ); |
| 22 |
|
| 23 |
// Initialization |
| 24 |
$this->addClasses( [ 'oo-ui-horizontalLayout' ] ); |
| 25 |
if ( isset( $config['items'] ) ) { |
| 26 |
$this->addItems( $config['items'] ); |
| 27 |
} |
| 28 |
} |
| 29 |
} |