Debian Codegraph @

vendor/ipl/web/src/Widget/VerticalKeyValue.php

raw
1 <?php
2
3 namespace ipl\Web\Widget;
4
5 use ipl\Html\BaseHtmlElement;
6 use ipl\Html\Html;
7
8 class VerticalKeyValue extends BaseHtmlElement
9 {
10 protected $key;
11
12 protected $value;
13
14 protected $tag = 'div';
15
16 protected $defaultAttributes = ['class' => 'vertical-key-value'];
17
18 public function __construct($key, $value)
19 {
20 $this->key = $key;
21 $this->value = $value;
22 }
23
24 protected function assemble()
25 {
26 $this->add([
27 Html::tag('span', ['class' => 'value'], $this->value),
28 Html::tag('br'),
29 Html::tag('span', ['class' => 'key'], $this->key),
30 ]);
31 }
32 }