4

I am tasked with creating a couple of new forms on the front-end, and had the idea to use Varien_Data_Form instead of hard-coding them.

Many of the forms in Magento Admin are built using the Varien_Data_Form class, as shown in this tutorial: http://astrio.net/blog/magento-admin-form/

I had a hard time finding any examples of this being used on the front-end, which made me think there might be a reason why.

Does anyone have any experience (or better, examples) of using Varien_Data_Forms on Magento's front-end?

1

My recommendation is to stay away from Varien_Data_Form for anything other than adminhtml development (in which case, you're pretty much forced to use it). It takes the simple task of creating a form and abstracts it away into an abyss of PHP/Magento nonsense.

Keep it simple. Create a form. If you want to make it dynamic, output the fields dynamically (or render them dynamically on the client side with a JS templating engine).

| improve this answer | |
  • 1
    +1 for " abyss of PHP/Magento nonsense". What about using Zend_Form rather than Varien_Data_Form? – Tim Hallman May 19 '15 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.