| Total Complexity | 4 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | class Framework extends \Formularium\Framework |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The viewable template. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $viewableTemplate = ''; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $editableTemplate = ''; |
||
| 21 | |||
| 22 | public function __construct(string $name = 'Blade') |
||
| 27 | {!! Form::open(['route' => '{{modelName}}.store']) !!} |
||
| 28 | |||
| 29 | {{form}} |
||
| 30 | |||
| 31 | {!! Form::submit('Submit', ['class' => 'btn btn-info']) !!} |
||
| 32 | |||
| 33 | {!! Form::close() !!} |
||
| 34 | EOF; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function editableCompose(Model $m, array $elements, string $previousCompose): string |
||
| 38 | { |
||
| 39 | $editableForm = join('', $elements); |
||
| 40 | $templateData = [ |
||
| 41 | 'form' => $editableForm, |
||
| 42 | ]; |
||
| 43 | |||
| 44 | return $this->fillTemplate( |
||
| 45 | $this->editableTemplate, |
||
| 46 | $templateData, |
||
| 47 | $m |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function fillTemplate(string $template, array $data, Model $m): string |
||
| 72 | } |
||
| 73 | } |
||
| 74 |