addScript('js/lib/form-element-phone.js'); } protected function _addResources() { /** @var $doc Qs_Doc */ $doc = Zend_Registry::get('doc'); $doc->addScripts($this->getScripts()); /** @var Qs_Form_Element_Phone $element */ $element = $this->getElement(); $options = ['format' => $element->getFormat()]; $doc->addInitFunction('Qs_Form_Element_Phone.init', [$element->getId(), $options]); return $this; } public function render($content) { $this->_addResources(); return $content; } }