set form action in zf

Aug 28, 2011   //   by kdecom   //   zend framewok 2, ZEND FRAMEWORK, zf2  //  No Comments
Today i got a problem in setting up the zf form action url.

finally i found a simple way of adding it.

Inside your Form Classs For example in my case it was.

class Admin_Forms_AddProjectType extends Kdecom_Form {

    public function __construct($options = null) {

        $projectTypeName = $this->CreateElement(‘text’, ‘project-type-name’)
                        ->setLabel(‘Project Type Name:’)->setAttrib(‘class’, ‘projectTypeName’);

        $submit = $this->CreateElement(‘submit’, ‘submit’)->setLabel(‘Save’);


 I hope that helps.

Leave a comment