Beispiel #1
0
 /**
  * Create a listing HTML element.
  *
  * @param  string  $type
  * @param  array   $list
  * @param  array   $attributes
  *
  * @return string
  */
 public static function make($type, array $list, array $attributes = [])
 {
     if (count($list) == 0) {
         return '';
     }
     $html = static::makeElements($type, $list);
     $attributes = Attributes::make($attributes);
     return "<{$type}{$attributes}>{$html}</{$type}>";
 }
Beispiel #2
0
 /**
  * Generate a meta tag.
  *
  * @param  string  $name
  * @param  string  $content
  * @param  array   $attributes
  *
  * @return string
  */
 public static function make($name, $content, array $attributes = [])
 {
     $attributes = Attributes::make(array_merge(compact('name', 'content'), $attributes));
     return "<meta{$attributes}>" . PHP_EOL;
 }
Beispiel #3
0
 /**
  * Create a form label element.
  *
  * @param  string  $name
  * @param  string  $value
  * @param  array   $attributes
  * @param  bool    $escaped
  *
  * @return string
  */
 public static function make($name, $value = null, array $attributes = [], $escaped = true)
 {
     $value = static::format($name, $value);
     return implode('', ['<label for="' . $name . '"' . Attributes::make($attributes) . '>', $escaped ? e($value) : $value, '</label>']);
 }