[Catalyst] Handling add/edit screens
Dave Hodgkinson
davehodg at gmail.com
Tue Mar 14 10:45:35 CET 2006
On 14 Mar 2006, at 04:27, moltar wrote:
> This is a very common scenario. First you have a form to add a record,
> and then later you want to edit the record. Sometimes the records is
> *almost* the same, but not quite.
>
> For example, editing a user profile - users must provide a username
> when
> registering, but can't change it on the edit screen. Also while
> editing
> user profile, they must provide an old password and a new one
> twice. But
> the rest of the form (name, email, address, etc...) is exactly the
> same.
>
> What are the best methods for handling these kinds of forms? What
> concerns me most is the code/template repetition.
>
I have the form part in a form.tt with the relevant IFs in there.
form.tt is then included in the views for create and update.
--
Dave Hodgkinson - Music photography
http://www.hodgkinson.org/
More information about the Catalyst
mailing list