Destramic Posted May 8, 2011 Share Posted May 8, 2011 hey guys im currently making a framework at the moment which is working fine but i want to be able to add modules and a routing system but firstof all i dont know if i understand it fully if anyone can help. MODULES basically adding a module you would be able to direct controller: news action: articles like so $modules->add_module('news', array('controller' => 'news', 'action' => 'articles' )); which would direct http://domain.co.uk/news to the news / articles controlller and action ... is that how it should work? ROUTING and the routing to work as such $route->add_route(':username', array('controller' => 'user', 'action' => 'info')); so that the url from user/info controller and action would be http://domain.co.uk/destramic if someone could please help to shine a bit of light on this so i can understand a bit better please or if anyone has a good site or read up on this...thank you Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/ Share on other sites More sharing options...
trq Posted May 9, 2011 Share Posted May 9, 2011 Both examples look like simple routes to me, the first is just a hard coded value instead of the more dynamic :something version. I'm not exactly sure why your naming the first example a module. In my github (link in signature) there is a repo called proem, this is my simple framework (that isn't near complete), there is a pretty simple Router within that if your looking for some examples. Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/#findComment-1212729 Share on other sites More sharing options...
Destramic Posted May 10, 2011 Author Share Posted May 10, 2011 Yeah an example on how the routing system would be great if you could please...and with the modules part I saw it on the zend framework...thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/#findComment-1213337 Share on other sites More sharing options...
trq Posted May 11, 2011 Share Posted May 11, 2011 Did you actually read my last reply? Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/#findComment-1213756 Share on other sites More sharing options...
Destramic Posted May 11, 2011 Author Share Posted May 11, 2011 sorry haha...i must of just read if quickly but thanks for that ive seen your examples of your routing system so its something to go of...also do you know much about the zend framework?...im just wondering what the modules are actually for?...thanks again thorp Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/#findComment-1213877 Share on other sites More sharing options...
trq Posted May 11, 2011 Share Posted May 11, 2011 Ive used Zend on a few projects. Modules are just a way to group controllers together into separate sections. It gives your urls more depth eg; /module/controller/action vs /controller/action Quote Link to comment https://forums.phpfreaks.com/topic/235848-framework-routing-modules-questionhelp/#findComment-1214053 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.