views:

137

answers:

2

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.

A: 

Hi, there is an excelent example for an Custom image "Preview" Element:

Zend Form with Image

Or try the Zend_Form_Element_Image shipped with the Framework

Zend Form Element Image

ArneRie
hi, i think you have misunderstood me slightly. maybe i wasnt clear enough. Your solutions are both for using images as part of a form, what i need is to display images within the form but they are not actual form elements.
seengee
+1  A: 

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

devians