Cardale Posted March 9, 2008 Share Posted March 9, 2008 I've been trying to figure out a good way to have a controller and loader class that is still within the MVC design pattern. Basicly this is what I think it should do from looking over other frameworks and projects. Controller will handle the requests from get and post methods...is there anything else? loader class will auto load these classes from the controller.... Should I be looking to expand these any do I need to look into something else maybe more abstraction? I'm just learning MVC and new PHP5 functionality. Quote Link to comment Share on other sites More sharing options...
Cardale Posted March 9, 2008 Author Share Posted March 9, 2008 bump* Quote Link to comment Share on other sites More sharing options...
aschk Posted March 14, 2008 Share Posted March 14, 2008 Probably a good place to start with is __autoload() . Specify this function and it'll help you load up your classes without the need for includes or namespaces. Probably not quite what you meant about a loader however... In regards to initialising your application controller and loader. A lot of higher class languages use XML for a configuration file. So ideally I would expect the initialisation process to be. 1) Initialise front controller 2) Initialise application helper (contains methods for initialising the XML application file and other registry options) 3) Get application controller from the helper 4) Iterate through the application controller's commands 5) Call execute() (interface based) on each command that is returned 6) The internals of the command decide whether to forward to another command. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.