| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function __construct( |
||
| 21 | $name, |
||
| 22 | $label, |
||
| 23 | $renderForBlocks = false, |
||
| 24 | $renderForModal = false |
||
| 25 | ) { |
||
| 26 | // This can be null. In that case the field might be used outside of a form and we have no shared $form. |
||
| 27 | $form = View::shared("form"); |
||
| 28 | $this->renderForBlocks = $renderForBlocks; |
||
| 29 | $this->item = $form['item'] ?? null; |
||
| 30 | $this->form_fields = $form['form_fields'] ?? []; |
||
| 31 | $this->name = $name; |
||
| 32 | $this->label = $label; |
||
| 33 | |||
| 34 | $shared = View::shared('TwillUntilConsumed', []); |
||
| 35 | foreach ($shared as $key => $value) { |
||
| 36 | $this->{$key} = $value; |
||
| 37 | } |
||
| 40 |