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 Answer 1

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).

1
  • 1
    +1 for " abyss of PHP/Magento nonsense". What about using Zend_Form rather than Varien_Data_Form? May 19, 2015 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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