Skinner2001 Posted January 12, 2012 Share Posted January 12, 2012 Hi I need help! I am trying to add some forms to a site. The whole thing is in Zend. I am trawling through the code and can only find $this-form on a page which does create an existing form. How do I create my own forms??? Quote Link to comment https://forums.phpfreaks.com/topic/254882-zend-forms/ Share on other sites More sharing options...
Garethp Posted January 13, 2012 Share Posted January 13, 2012 Under a "forms" folder, create a model that extends Zend_Form, override the init function for adding elements class Something_Form_Login extends Zend_Form { public function init() { $Username = new Zend_Form_Element_Text('Username'); $Username->setLabel('Username'); $Password = new Zend_Form_Element_Password('Password'); $Password->setLabel('Password'); $Submit = new Zend_Form_Element_Submit('Submit'); $this->addElements(array($Username, $Password, $Submit)); } } Quote Link to comment https://forums.phpfreaks.com/topic/254882-zend-forms/#findComment-1307131 Share on other sites More sharing options...
Skinner2001 Posted January 13, 2012 Author Share Posted January 13, 2012 Great thanks for the help. Where I need it is: I have 3 new links to different forms and need these links to go to the 3 different forms pages. If I give you the URL it is: http://www.weddingtalk.co.uk/index/add-listing/ Now the 4 boxes on the right numbered 1 - 4 go to forms. Number 1 works fine but if I am to add 3 new forms for 2, 3 & 4 I need to figure out what type is, and trawling through the code just makes me more confused... Quote Link to comment https://forums.phpfreaks.com/topic/254882-zend-forms/#findComment-1307210 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.