I think this is meant for fw-mvc -- I could be wrong.
The way I like to tackle this problem is by creating my own element type.
So I'd say something like
$image = new App_Form_Element_ImageList('images'), where
App_Form_Element_ImageList is defined as follows:
class App_Form_Element_ImageList extends Zend_Form_Element_Xhtml {
protected $_helper = 'FormImageList'; ... }
You'd then have to create a view helper for it, so something like
class App_View_Helper_FormImageList extends Zend_View_Helper_Abstract { ... }
If your image list requires JS, you can add that to the view helper.
Hope that gives you a start!
Neil Garb
http://codecaine.co.za
On Thu, Apr 23, 2009 at 3:12 PM, Raavi Raaj <raaviraaj77@gmail.com> wrote:
> Hi,
>
> I have a table which stores images for products. A product may contain more
> than 1 image.
> The image table looks line (id, file_name, description, sort_order, prod_id,
> ...)
>
> I would like to display a form which looks like...
> SORT IMAGES (one row per record)
> image_1 [text_box_1]
> image_2 [text_box_2]
> image_3 [text_box_3]
> ...
> [Submit button]
>
> The user can enter sort order for images and sublit the changes
>
> My question... how do I polulate the form with the array data and also
> retrive it on submission?
>
> All guidance and help is appreciated.
>
> -R
没有评论:
发表评论