-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Col.php
49 lines (43 loc) · 1.21 KB
/
Col.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
/**
* This file is part of the EaseTWBootstrap3 package
*
* https://github.com/VitexSoftware/php-ease-twbootstrap
*
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Ease\TWB;
class Col extends \Ease\Html\DivTag
{
/**
* Bunka CSS tabulky bootstrapu.
*
* @see http://getbootstrap.com/css/#grid
*
* @param int $size Velikost políčka 1 - 12
* @param mixed $content Obsah políčka
* @param string $target Typ zařízení xs|sm|md|lg
* @param array $properties Další vlastnosti tagu
*/
public function __construct(
$size,
$content = null,
$target = 'md',
$properties = []
) {
if (\array_key_exists('class', $properties)) {
$addClass = $properties['class'];
} else {
$addClass = '';
}
$properties['class'] = 'col-'.$target.'-'.$size;
parent::__construct($content, $properties);
if (\strlen($addClass)) {
$this->addTagClass($addClass);
}
}
}