card.php
30 lines
| 1 | <?php |
| 2 | /** |
| 3 | * User: shahnuralam |
| 4 | * Date: 17/11/18 |
| 5 | * Time: 1:09 AM |
| 6 | */ |
| 7 | if (!defined('ABSPATH')) die(); |
| 8 | $class = ''; |
| 9 | if(isset($attrs['class'])) { |
| 10 | $class = $attrs['class']; |
| 11 | unset($attrs['class']); |
| 12 | } |
| 13 | |
| 14 | ?> |
| 15 | <div class="card <?= $class ?>" <?php foreach ($attrs as $atname => $atval) { echo "$atname='$atval' "; } ?>> |
| 16 | <?php if($heading != ''){ ?> |
| 17 | <div class="card-header"><strong><?php echo $heading; ?></strong></div> |
| 18 | <?php } |
| 19 | if(count($content) > 0){ |
| 20 | foreach ($content as $html) { |
| 21 | ?> |
| 22 | <div class="card-body"><?php echo $html; ?></div> |
| 23 | <?php |
| 24 | } |
| 25 | } |
| 26 | if($footer != ''){ |
| 27 | ?><div class="card-footer"><?php echo $footer; ?></div><?php |
| 28 | } |
| 29 | ?></div> |
| 30 |