chemdream Posted October 4, 2012 Share Posted October 4, 2012 Freaks, My goal is trying to edit the code below so, no matter what, everything gets sent to the Index controller: so, for example: http://domain.tld/page would go to the Index Controller, and call the pageAction method. right now, that would get sent to the page controller... Yaf_Dispatcher::getInstance()->getRouter()->addRoute( "pages", new Yaf_Route_Regex( "#^/index/page/(\d+)#", array('controller' => "Index"), array(1 => "page") ) ); I'm horrible with regular expressions. I'm pretty sure I could just edit #^/index/page/(\d+)# (and remove the 2nd part of the array) and it will just work. Any help would be greatly appreciated! There is a bit of info here about it: http://php.net/manual/en/yaf-route-rewrite.construct.php THANK YOU! Link to comment https://forums.phpfreaks.com/topic/269087-everything-to-one-controller/ Share on other sites More sharing options...
trq Posted October 4, 2012 Share Posted October 4, 2012 I would create your own Route object. There is no need to use the Yaf_Route_Regex Route if your simply going to map everything to a single controller anyway. Link to comment https://forums.phpfreaks.com/topic/269087-everything-to-one-controller/#findComment-1382750 Share on other sites More sharing options...
chemdream Posted October 5, 2012 Author Share Posted October 5, 2012 I would create your own Route object. There is no need to use the Yaf_Route_Regex Route if your simply going to map everything to a single controller anyway. Sorry, I'm not sure what you mean. heh. Do you think you could give an example or a link to an example? The YAF documents aren't complete so I'm feel like I'm flying a bit blind. heh. Link to comment https://forums.phpfreaks.com/topic/269087-everything-to-one-controller/#findComment-1382870 Share on other sites More sharing options...
chemdream Posted October 5, 2012 Author Share Posted October 5, 2012 Sorry, I'm not sure what you mean. heh. Do you think you could give an example or a link to an example? The YAF documents aren't complete so I'm feel like I'm flying a bit blind. heh. I should also mention that I'm using YAF for MVC... Only for this one project do I need everything to go through one controller. But still need YAF to take care of the layout, views and other stuff. Thanks! Link to comment https://forums.phpfreaks.com/topic/269087-everything-to-one-controller/#findComment-1382887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.