[eluser]Unknown[/eluser]
Hello,
I am new to MVC and frameworks so sorry if this is a dummy question.
Previously working with plain PHP I have submitted forms to the same page then in the code put:
Code:
if($_POST) {
//do form
} else {
//do something else
}
From all of the online tutorials I have noticed people post forms to a new function similar to the following:
Code:
class User extends Controller {
function login() {
// normal
}
function login_submit() {
//submit form
}
}
Is this the right way of going about things or can I post to the same function if I want?
It seems that for things like admin areas where there are lots of forms I will need double the amount of functions especially when the login() function appears to just serve a view and doesn't particularly do anything else.
Thanks
Dave.