Welcome Guest, Not a member yet? Register   Sign In
Question regarding the uri + more
#4

[eluser]Michael Wales[/eluser]
Quote:I’m not sure what you mean by resources (just started using MVC)?
From what I understand I use a controller for each page, for example:
register
register/submit
register/error
register/<another subpage (function)>


Using jedd's mention of a resource, and your example above, go through the following thoughts:
- What is registering?
- What else will whatever is registering need to do?

Hopefully you go down this line of thinking:
- Accounts are being registered
- Accounts will need to register, retrieve forgotten passwords, login and logout

accounts/register
accounts/retrieve-password
accounts/login
accounts/logout

Quote:register/submit
We usually self-submit forms. You display a form on a conditional basis (if validation did not pass), submit the form to itself where it will check for validation and then either display the form again (on failure) or do database stuff (and then redirect somewhere else, to prevent double-submit).

Quote:register/error
Very rarely will you need a function just dedicated to displaying errors. Running with the form example above: when validation fails you would dump the reasons for failure into a variable, then in your view - if that variable exists, display the content.


Messages In This Thread
Question regarding the uri + more - by El Forum - 06-30-2009, 10:10 AM
Question regarding the uri + more - by El Forum - 06-30-2009, 10:36 AM
Question regarding the uri + more - by El Forum - 06-30-2009, 12:09 PM
Question regarding the uri + more - by El Forum - 06-30-2009, 12:33 PM
Question regarding the uri + more - by El Forum - 06-30-2009, 02:20 PM
Question regarding the uri + more - by El Forum - 07-02-2009, 04:38 AM
Question regarding the uri + more - by El Forum - 07-02-2009, 07:47 AM
Question regarding the uri + more - by El Forum - 07-02-2009, 02:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB