1: <?php
2:
3: /**
4: * Copyright 2015, Eduardo Trujillo
5: *
6: * For the full copyright and license information, please view the LICENSE
7: * file that was distributed with this source code.
8: *
9: * This file is part of the Nucleus package
10: */
11:
12: namespace Chromabits\Nucleus\View\Bootstrap;
13:
14: use Chromabits\Nucleus\Support\Arr;
15: use Chromabits\Nucleus\View\Node;
16:
17: /**
18: * Class Row.
19: *
20: * @author Eduardo Trujillo <ed@chromabits.com>
21: * @package Chromabits\Nucleus\View\Bootstrap
22: */
23: class Row extends Node
24: {
25: /**
26: * Construct an instance of a Row.
27: *
28: * @param array $attributes
29: * @param \string[] $content
30: * @param bool|false $fluid
31: */
32: public function __construct(
33: array $attributes,
34: $content,
35: $fluid = false
36: ) {
37: if (Arr::has($attributes, 'class')) {
38: $attributes['class'] = implode(' ', [
39: 'row',
40: $attributes['class'],
41: ]);
42: } else {
43: $attributes['class'] = 'row';
44: }
45:
46: parent::__construct('div', $attributes, $content, false);
47: }
48: }
49: