| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function init(): void |
||
| 11 | { |
||
| 12 | $this->setMethod('get'); |
||
| 13 | $this->setName('quickSearch'); |
||
| 14 | $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); |
||
| 15 | $view = $viewRenderer->view; |
||
| 16 | |||
| 17 | $this->setAction($view->serverUrl() . $view->url(['controller' => 'movie', 'action' => 'index'], 'default', false)); |
||
| 18 | |||
| 19 | // Add the comment element |
||
| 20 | $this->addElement('text', 'search', [ |
||
| 21 | 'placeholder' => _tr('search movie…'), |
||
| 22 | 'decorators' => ['ViewHelper'], |
||
| 23 | ]); |
||
| 24 | |||
| 25 | // Add the submit button |
||
| 26 | $this->addElement('submit', 'searchSubmit', [ |
||
| 27 | 'label' => _tr('Search'), |
||
| 28 | 'decorators' => ['ViewHelper'], |
||
| 29 | ]); |
||
| 30 | |||
| 31 | $this->addDecorator('FormElements') |
||
| 32 | ->addDecorator('HtmlTag', ['tag' => 'span']) |
||
| 33 | ->addDecorator('Form'); |
||
| 34 | } |
||
| 36 |