0

I need some help structuring my website.

I have a home.php controller that just draws the home page. The members.php controller is basically handling everything else from checking if a user is logged in, to sending users to the signup page, and data to the membership_model.php.

My question is: Should I arrange this differently? Shouldn't my home.php controller be responsible for loading the correct views when a user clicks a given link. If the user clicks a REGISTER button, shouldn't the home.php controller load the template of the registration page? I just feel its wrong to have the controller that loads the home page do only that.

If I have a register method in the home page controller, and also have a register.php controller to handle things that happen from the registration page, is that okay? Is that proper?

Thanks a lot!

1
  • 3
    IF it works, then it probably doesn't matter. Now go accept some previous answers please. Commented Jun 10, 2012 at 20:30

2 Answers 2

3

You should split it according to your needs. There's not a "best" way of doing so.

Use the home controller to handle the visual part of the website and leave another to handle all user related actions (like userpanel, register, login, etc). At least that's what i'd do. There's not a recipe for this

Sign up to request clarification or add additional context in comments.

Comments

0

Don't worry about having a home controller that only loads the home page. If thats what you need thats what you need. It's better to keep things organised and have a file with little in it than stick in some other place that makes no sense.

Like Nicolas I use a users.php controller which does, login, logout, register etc...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.