php - Zend 2.0 with Smarty: display Zend Form on .tpl file -


i have trouble in zend 2.0. made tutorial: https://packages.zendframework.com/docs/latest/manual/en/user-guide/skeleton-application.html , implemented smarty by: how can smarty 3 used zend framework 2? displaying form zend_from in .phtml looks this:

$form = $this->form; $form->setattribute('action', $this->url('album', array('action' => 'add'))); $form->prepare(); echo $this->form()->opentag($form); echo $this->formhidden($form->get('id')); echo $this->formrow($form->get('title')); echo $this->formrow($form->get('artist')); echo $this->formsubmit($form->get('submit')); echo $this->form()->closetag(); 

but how display $this->form smarty template?

solution is:

{assign var="form" value=$this->form} {assign var="attr" value=$form->setattribute('action', $this->url('album', ['action' => 'add']))} {assign var="prep" value=$form->prepare()} {$this->form()->opentag($this->form)} {$this->formcollection($this->form)} {$this->form()->closetag()} 

Comments