| Conditions | 1 |
| Paths | 1 |
| Total Lines | 42 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 14 | public function render(array $parameters, HTMLNode $previous): HTMLNode |
||
| 15 | { |
||
| 16 | $id = 'upload' . HTMLFramework::counter(); |
||
| 17 | $vmodel = 'file'; // TODO: test |
||
| 18 | return HTMLNode::factory( |
||
| 19 | 'b-field', |
||
| 20 | [ |
||
| 21 | 'class' => 'formularium-upload file' |
||
| 22 | ], |
||
| 23 | [ |
||
| 24 | HTMLNode::factory( |
||
| 25 | 'b-upload', |
||
| 26 | [ 'v-model' => $vmodel ], |
||
| 27 | [ |
||
| 28 | HTMLNode::factory( |
||
| 29 | 'a', |
||
| 30 | [ |
||
| 31 | 'id' => $id, |
||
| 32 | 'class' => 'button is-primary', |
||
| 33 | ], |
||
| 34 | [ |
||
| 35 | HTMLNode::factory( |
||
| 36 | 'b-icon', |
||
| 37 | [ 'icon' => 'upload'] |
||
| 38 | ), |
||
| 39 | HTMLNode::factory( |
||
| 40 | 'span', |
||
| 41 | [], |
||
| 42 | $parameters[self::LABEL] ?? 'Click to upload' |
||
| 43 | ) |
||
| 44 | ] |
||
| 45 | ), |
||
| 46 | ] |
||
| 47 | ), |
||
| 48 | HTMLNode::factory( |
||
| 49 | 'span', |
||
| 50 | [ |
||
| 51 | 'class' => 'file-name', |
||
| 52 | 'v-if' => $vmodel |
||
| 53 | ], |
||
| 54 | "{{{$vmodel}.name}}", |
||
| 55 | true |
||
| 56 | ) |
||
| 67 |