@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * HTML generator |
|
| 5 | - * Marker, hommage to Christian François Bouche-Villeneuve aka Chris Marker |
|
| 6 | - */ |
|
| 4 | + * HTML generator |
|
| 5 | + * Marker, hommage to Christian François Bouche-Villeneuve aka Chris Marker |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | declare(strict_types=1); |
| 9 | 9 | |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * ? makes more sense to write |
|
| 22 | - * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
| 23 | - * than |
|
| 24 | - * Marker::img(null, ['src' => 'path/to/img.jpg', 'alt' => 'An alternative text', 'width' => 34, 'height' => 34]) |
|
| 25 | - */ |
|
| 21 | + * ? makes more sense to write |
|
| 22 | + * Marker::img('path/to/img.jpg', 'An alternative text', ['width' => 34, 'height' => 34]) |
|
| 23 | + * than |
|
| 24 | + * Marker::img(null, ['src' => 'path/to/img.jpg', 'alt' => 'An alternative text', 'width' => 34, 'height' => 34]) |
|
| 25 | + */ |
|
| 26 | 26 | public static function img(string $src, string $alt, array $attributes = []): Element |
| 27 | 27 | { |
| 28 | 28 | $attributes['src'] ??= $src; |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * ? makes more sense to write |
|
| 37 | - * Marker::a('controller/task/id', 'Click here', ['class' => 'nav']) |
|
| 38 | - * than |
|
| 39 | - * Marker::a('Click here', ['href' => controller/task/id', 'class' => 'nav']) |
|
| 40 | - */ |
|
| 36 | + * ? makes more sense to write |
|
| 37 | + * Marker::a('controller/task/id', 'Click here', ['class' => 'nav']) |
|
| 38 | + * than |
|
| 39 | + * Marker::a('Click here', ['href' => controller/task/id', 'class' => 'nav']) |
|
| 40 | + */ |
|
| 41 | 41 | public static function a(string $href, string $label, array $attributes = []): Element |
| 42 | 42 | { |
| 43 | 43 | $attributes['href'] ??= $href; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | foreach ($list as $value => $label) { |
| 72 | 72 | $option_attributes = ['value' => $value]; |
| 73 | 73 | if ($selected == $value) { |
| 74 | - $option_attributes['selected'] = 'selected'; |
|
| 74 | + $option_attributes['selected'] = 'selected'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $options .= new Element('option', "$label", $option_attributes); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public static function legend(string $label, array $attributes = []): string |
| 84 | 84 | { |
| 85 | - return '' . (new Element('legend', $label, $attributes)); |
|
| 85 | + return ''.(new Element('legend', $label, $attributes)); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public static function label(string $for, string $label, array $attributes = []): string |
@@ -125,6 +125,6 @@ discard block |
||
| 125 | 125 | unset($attributes['label']); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - return $label . (new Element($tag, $content, $attributes)); |
|
| 128 | + return $label.(new Element($tag, $content, $attributes)); |
|
| 129 | 129 | } |
| 130 | 130 | } |