solostyle / athousandpetals

business website
(work in progress)
1 stars 0 forks source link

Index 'default' page for each Division (controller) #4

Open solostyle opened 13 years ago

solostyle commented 13 years ago

Right now the default page for the controllers are all called index. This must be somewhere hardcoded in my MVC, probably the shared.php? Anyway, either make the index.php make sense and have worth, or just scrap it and use about, or the first link on the left of the midnav bar, as the default page. Maybe each controller has its own default page?

solostyle commented 13 years ago

Yeah it is in shared.php line 120 as of now. It sets the default action as index if there is nothing after the controller name in the URI

solostyle commented 13 years ago

Okay, so now the question is how do I add this functionality? I can think of a few ways that would work, but what if they're all bad ways? I could do something similar to routing.php where i pass in a controller to a defaultAction() funciton and spit back the default action for that controller. So it would probably be like a switch statement. That doesn't seem so clever..

Does it have to be hardcoded in there somewhere. Isn't there any other way for the system to just know what the default action for a particular controller is? Bah.

solostyle commented 12 years ago

maybe store all the possible views (actions) for a controller somewhere, probably an enum in the database, and have the first item in the list be the default.

also in header.php where i hardcode the list of actions for each controller in the midnav, i can query the db instead.

seems like a lot of querying ,but it might be worth it for the consistency.