2008年8月6日星期三

[fw-mvc] Editable multi-row form 7A2-99B

2008/8/5 Gordon Ross <gr306@ucs.cam.ac.uk>:
> I'm looking to create a form (and necessary controller methods, etc) to edit multiple database rows at a time.
> I've got some vague ideas of how to do it. However, I'm not sure how to tell the form __construct method (where the form is assembled) how many rows there are (This can only be known at runtime)

You had better assemble the form by subclassing the init() method of
Zend_Form; it is a template method that you can use at your will and
is called at the end of Zend_Form::__costruct().

> Should I just modify the __construct method call to add an extra parameter to specify this ?
I am not sure if changing the signature of a method (like the
constructor) is a violation of strict standards. You can add a method
setXxxFieldNumber() that does the work and that you call after
instantiation.

--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://www.sourceforge.net/projects/ossigeno

没有评论: