Php – HTML snippet within Zend_Form

PHPzend-formzend-framework

I'm using Zend_Form as part of a simple signup process. In part 1 of 2 the user is able to upload a number of images. In part 2 – for each one of these images – I ask the user to add further details – an additional 4 text fields grouped together using addDisplayGroup. Within each display group I want to display a thumbnail of the uploaded image. I have generated these thumbs and all the processing is complete but i'm unsure what the best approach is for displaying the image within the relevant section. I guess its possible to create a custom form element to display this but somehow this feels like overkill considering the image is purely being used for display purposes. I also dont really want to replace $this->form->render() with a manual outputting of the form. Could this be achieved with a decorator maybe? I'm still fairly new to ZF so any ideas would be much appreciated.

Thanks.

Best Answer

You would use a custom decorator in your decorator stack for the display group. Or you could use the HtmlTag decorator.

http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.displaygroups

Related Topic