2008年8月16日星期六

RE: [fw-mvc] Views Vs Zend_Forms

And I've found the answer:

http://davidcaylor.com/php/building-table-based-forms-in-zend_form

Shows how to use subforms to control very nicely the layout of the form.

GTG
________________________________________
From: Gordon Ross [gr306@ucs.cam.ac.uk]
Sent: 14 August 2008 15:48
To: 'fw-mvc@lists.zend.com'
Subject: Re: [fw-mvc] Views Vs Zend_Forms

One of the things I'm looking to do, is have a table with each row being a row from the DB (Done) but with other stuff outside that table. *That's* the bit I can't see how to do, without some heavy work of using custom decorators.

GTG

----- Original Message -----
From: Tom Graham <tom.graham@jadu.co.uk>
To: Gordon Ross <gr306@ucs.cam.ac.uk>
Cc: Zend Framework MVC <fw-mvc@lists.zend.com>
Sent: Thu Aug 14 15:44:58 2008
Subject: Re: [fw-mvc] Views Vs Zend_Forms

Yes, but no.

You can use form decorators to adjust the markup of the Zend_Form to
exactly how you want it or even create custom Zend_Form_Elements,
which is what I did when I needed a location picker using the Google
Maps API. The possibilities are endless, albeit more difficult than
writing HTML to begin with.

Tom

On 14 Aug 2008, at 15:26, Gordon Ross wrote:

> There are basically two ways, from what I can see, to create a web
> page in
> Zend: Create a Zend_Form object in the controller action, or create a
> view-web page.
>
> The Zend_Form method allows you to programmatically generate the
> HTML, plus
> all necessary code for validation, etc., but can be slightly
> restrictive in
> the layout/HTML it generates.
>
> A View web page allows you to generate as much fancy HTML as you
> want to
> through at it. The big downside is that it doesn't have any automatic
> validation or guarantee correct HTML as you're manually writing it.
> It also
> can be messy as you switch between HTML & PHP code.
>
> Is this an accurate comparison ?
>
> Thanks,
>
> GTG
>
>
>

没有评论: