| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | protected function createForm(string $entityName, $id = null) |
||
| 46 | { |
||
| 47 | $entity = $this->app->getEntity($entityName); |
||
| 48 | |||
| 49 | $form = F::form() |
||
| 50 | ->method('post') |
||
| 51 | ->enctype('multipart/form-data') |
||
| 52 | ->add([ |
||
| 53 | 'entity' => F::hidden()->val($entityName)->class('field-data-entity'), |
||
| 54 | 'data' => $entity->getScheme($this->app->get('builder')), |
||
| 55 | ]); |
||
| 56 | |||
| 57 | if ($id !== null) { |
||
| 58 | $form['id'] = F::hidden()->val($id)->class('field-data-id'); |
||
| 59 | } |
||
| 60 | |||
| 61 | return $form; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |