| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function init(): void |
||
| 10 | { |
||
| 11 | // Set the method for the display form to GET |
||
| 12 | $this->setMethod('get'); |
||
| 13 | |||
| 14 | // Add the comment element |
||
| 15 | $this->addElement('text', 'id', [ |
||
| 16 | 'label' => _tr('IMDb url or id:'), |
||
| 17 | 'required' => true, |
||
| 18 | 'autofocus' => true, |
||
| 19 | 'validators' => [ |
||
| 20 | ['validator' => 'Regex', 'options' => ["/(\d{7,})/"]], |
||
| 21 | ], |
||
| 22 | ]); |
||
| 23 | |||
| 24 | // Add the submit button |
||
| 25 | $this->addElement('submit', 'submit', [ |
||
| 26 | 'ignore' => true, |
||
| 27 | 'label' => _tr('Add movie'), |
||
| 28 | ]); |
||
| 31 |