Hi Jean-Marc,

Jean-Marc Fontaine a écrit :
The problem is that the Zend_Form_Element is built to handle only on value
and more generally Zend_Form currently does not seem to be able to handle
what I want to build.

What I want is not an element that aggregates other elements but handle one
single value. I want something like the display groups but for logic. That
way I could reuse components over and over.

For example, I want to built a component to handle pictures. It would
contain a file element for the picture itself, a checkbox to remove the
current picture, a html img tag to preview the current picture and a text
box for the alt attribute. I have in mind something we often see in CMS like
eZ Publish for example.


It is something that I wanted to do too but I haven’t the time to get my hand on.
So I would be interested by the solution you come up with :)

I was thinking by a Zend_Form::addAggregateElement(‘myimage’) method where the aggregate element will add the elements it needs to the form and those elements will be use by his mate view helper for rendering. I’m not using Zend_Form for rendering so the last step should be trivial for me but I’m not sure how easy it is to have it rendered by Zend_Form.

Regards,
Laurent


--
Laurent Melmoux
Conseil et Solutions Web | [EMAIL PROTECTED]
2mx - Annecy, France     | http://www.2mx.fr/


Reply via email to