mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
NameValueTable: new ipl widget
This commit is contained in:
parent
0dbc9722cf
commit
406bc8bd72
29
library/vendor/ipl/Web/Widget/NameValueTable.php
vendored
Normal file
29
library/vendor/ipl/Web/Widget/NameValueTable.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace ipl\Web\Widget;
|
||||
|
||||
use ipl\Html\Table;
|
||||
|
||||
class NameValueTable extends Table
|
||||
{
|
||||
protected $defaultAttributes = ['class' => 'name-value-table'];
|
||||
|
||||
public function createNameValueRow($name, $value)
|
||||
{
|
||||
return $this::tr([$this::th($name), $this::td($value)]);
|
||||
}
|
||||
|
||||
public function addNameValueRow($name, $value)
|
||||
{
|
||||
return $this->body()->add($this->createNameValueRow($name, $value));
|
||||
}
|
||||
|
||||
public function addNameValuePairs($pairs)
|
||||
{
|
||||
foreach ($pairs as $name => $value) {
|
||||
$this->addNameValueRow($name, $value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user