Jump to content

Forms (Multi-Form, Single Form)


Ninjakreborn

Recommended Posts

Which one is better for standards practices in PHP.

 

1. Using the same form for everything. (Add and edit). Meaning setting up one form to handle adding new records, as well as editing existing records. 

 

Or

 

2. Using two different forms for both actions. Use one form/area to handle Adding, and one form/area to handle editing.

 

Which one of these are better from a standards/practice point of a view.  Which one better fits into the MVC platform (a framework like Codeignitor, or Cake).

Should their be separate controller functions/views for add and edit or should they all be in the same controller function/form.

 

Thanks for the feedback.

Link to comment
Share on other sites

I'm not sure if there is a standard.  I've seen many professional projects do it both ways.  As for Cake, if you use "Bake", their code generator, it creates a separate form template for add and edit, as well as a separate controller action for each.  This makes more sense to me and helps keep the logic separate.  Since all validation etc. will be done once in the model, then there is no code duplication.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.