I'm write a multi-page profile site. It's just all fields, no content (other than "fill out these fields!").
I'm trying to create extendable elements with Zend_Form. The basic premise is I have several fields, about 15-20, of which about all are used on 1 or more pages. For example: email is used on 5 different pages. The exact same field, the exact same validation (in some cases, it needs to be the same field, with auto-population across different pages). I'd like to create one giant "fields" list, that defines every field used on the site in a fields.xml file. Then, within that same file, or another one, define field sets, which dynamically pulls in fields used for that specific section. For example: "login" uses <email> and <password> while "forgot-password" uses <email> and on the reset page, uses <password> and <password_retype>. We also have a pre-page which uses <email>, <email_retype> and birth-date fields (we have b-day validation). Our "update" and "register" pages also uses <email> as well as a log of other fields, some unique to select pages, but used on other pages. I would like to define <email> once, and then add it for each form piece, using XML definition. I could just make all fields load for every page, make them optional. Then extend it for each section make only select fields required where necessary. This would actually suit my needs, except this adds massive amounts of unnecessary form building -- something I'd like to avoid. (btw, we don't use $this->form; to print out my forms. We call render on each viewHelper(), Label() and Errors() to allow our web-devs 95% control over the HTML -- this gets around "but you'll just print out the entire form" reply). Is there any solution for my predicament? Can this be done? I can't find any route myself. --- Philip [email protected] http://www.gpcentre.net/
