Collective\Html\HtmlBuilder::dl PHP Метод

dl() публичный Метод

Generate a description list of items.
public dl ( array $list, array $attributes = [] ) : Illuminate\Support\HtmlString
$list array
$attributes array
Результат Illuminate\Support\HtmlString
    public function dl(array $list, array $attributes = [])
    {
        $attributes = $this->attributes($attributes);
        $html = "<dl{$attributes}>";
        foreach ($list as $key => $value) {
            $value = (array) $value;
            $html .= "<dt>{$key}</dt>";
            foreach ($value as $v_key => $v_value) {
                $html .= "<dd>{$v_value}</dd>";
            }
        }
        $html .= '</dl>';
        return $this->toHtmlString($html);
    }

Usage Example

Пример #1
0
 /**
  * Generate a description list of items.
  *
  * @param array $list
  * @param array $attributes
  * @return \Illuminate\Support\HtmlString 
  * @static 
  */
 public static function dl($list, $attributes = array())
 {
     return \Collective\Html\HtmlBuilder::dl($list, $attributes);
 }