Skip to content

Commit c0ee25e

Browse files
authored
Merge pull request #21 from VitexSoftware/20-add-cardbody
Initial CardBody class added
2 parents 445019c + 10e4bae commit c0ee25e

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

src/Ease/TWB4/CardBody.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of the EaseTWBootstrap4 package
7+
*
8+
* https://github.com/VitexSoftware/php-ease-twbootstrap4
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
16+
namespace Ease\TWB4;
17+
18+
use Ease\Html\DivTag;
19+
20+
/**
21+
* Bootstrap 4 Card Body component.
22+
*
23+
* Renders a div element with the 'card-body' CSS class for use within Bootstrap card components.
24+
*
25+
* @author Vítězslav Dvořák <info@vitexsoftware.cz>
26+
*/
27+
class CardBody extends DivTag
28+
{
29+
/**
30+
* Card.
31+
*
32+
* @param mixed $content Content to be added to the card body
33+
* @param array<string, string> $properties
34+
*/
35+
public function __construct($content = null, array $properties = [])
36+
{
37+
if (\array_key_exists('class', $properties)) {
38+
$properties['class'] = 'card-body '.$properties['class'];
39+
} else {
40+
$properties['class'] = 'card-body';
41+
}
42+
43+
parent::__construct($content, $properties);
44+
}
45+
}

0 commit comments

Comments
 (0)