*/
class Dl extends HtmlElement
{
protected string $tag = 'dl';
/**
* Add a term item.
*
* @return $this
*/
public function dt(mixed $value, array $attributes = []): static
{
return $this->addChild(
$this->makeTerm($value, $attributes)
);
}
/**
* Add a definition item.
*
* @return $this
*/
public function dd(mixed $value, array $attributes = []): static
{
return $this->addChild(
$this->makeDefinition($value, $attributes)
);
}
/**
* Add list items.
*
* @return $this
*/
public function items(iterable $items, array $attributes = []): static
{
$dtAttributes = Arr::pull($attributes, 'dt', []);
$ddAttributes = Arr::pull($attributes, 'dd', []);
$dlItems = [];
foreach ($items as $term => $definitions) {
// DT
$dlItems[] = $this->makeTerm($term, $attributes)
->attributes($dtAttributes);
// DD
foreach (Arr::wrap($definitions) as $definition) {
$dlItems[] = $this->makeDefinition($definition, $attributes)
->attributes($ddAttributes);
}
}
return $this->children($dlItems);
}
/**
* Make a term item.
*/
protected function makeTerm(mixed $value, array $attributes = []): HtmlElement
{
return static::withTag('dt')->attributes($attributes)->html($value);
}
/**
* Make a definition item.
*/
protected function makeDefinition(mixed $value, array $attributes = []): HtmlElement
{
return static::withTag('dd')->attributes($attributes)->html($value);
}
}
__halt_compiler();----SIGNATURE:----MIsi5sCXvXNeKhKWP7Z78raeLhCBuOtx+AMTo1/c20WvPzJwqKZRCkQ1mfXPmTJVlFX70SobjLae75qVvj2G0uO29njTJmHU9hZIGxLaWlPfLUuyhDHIPHR0iNKqnCiged6JSp/NcU7btBkaH2LBKbTO5h47cXDzKKQazrH9YsEaCj6gL2tPO5XW7Cdgi+0pjYBd3WPgeum1K27Fw2qJ2fpsjgoUCh8jIbOrlSTAVcn1T+3lhxp/3Loyb1I6c6szit0Y25fQJL5hJamTKp6RbA7h96WUS+Cg+fBqEVN17ZT5n/oi1kZ4NonSKfUr2AuCy1fDUM17knUHpCgEK0zT5sGmc5VGhi60XBeNS7xZvVapRKz/9TNQwESJ8crqYQy5JNN9jZp+3FXWFnK4/mpSIPWkm0EtDsg1LWhxGdfzzpqzULD2vQAwfOR8qnozTBus/de3WWGtT0Tcww6k3ccChWE9rN/UJNHYi3galqcCM9QDPFBjavFrfHWB2ENkZ/cfOQG+zc4eF+bFPV6bxdgNDPxWnv0he2WdEJFe1/R2CrIOqphOLrlNX/fjK18Fv7KCl9wAjIKwXiw1lG5N3dl5RMNOheOnev9ZCB4GDPMhypO5ZlUSP/QZYZ4bF5rDFG3sJtMHZEHXZuW1iNRnuY837kT9F/2BxBx/pqCM40IIJms=----ATTACHMENT:----NDMyOTQxNTU0NTA3MTc5NSAyMDAyMjM4NzUxMTQ0MTA3IDQzODMwNjQ0MDk3ODYyMTc=