views:

174

answers:

2

I've seen simple examples of rendering a Zend_Form using decorators, but I'm not sure they are able to handle the issue I'm facing very well.

I query the database and get an array of user objects. I want to display these users as a form, with a radio button next to each of them and a submit button at the bottom of the page.

Here's roughly what the form will look like:

   [user id]  [email]         [full name]
( ) 1         [email protected]   Test user 1
(*) 2         [email protected]  Test user 2
[SUBMIT]

Is this something achievable in a reasonably straightforward way or do I need to use the ViewScript partial?

+1  A: 

You should easily achieve this layout Leveraging Zend Form Decorators.

Edit:

You may be interested also on Zendcasts:
Zend Form decorators explained and Creating custom Zend Form Decorators.

BTW, This is pretty common layout for preferences:

Display preferences

Once you are finished, post your working code here for reference.

takeshin
Thanks! I've seen lots of articles on decorators but that's the first that tackles things in a way that works in my situation -- templating with sprintf rather than just clothing an input in static HTML.
RenderIn
I have added two more links to my original post.
takeshin
A: 

Just a quick suggestion. Why do you need table for this? The default definition list markup can be styled to look exactly like you want it to look.

Richard Knop
I need 3+ columns per row and I need headers for each column. Not sure how a list can ensure each column will line up with other rows' data and also with the headers.
RenderIn