LemonInflux Posted August 24, 2008 Share Posted August 24, 2008 Hey. I've been playing around with the framework a bit. I have a few questions to ask that I need clearing up... 1) How do I pass URL variables? ($_GET) 2) Say I have all my pages in my index controller. So all of the pages are in mysite.com/index. E.g. mysite.com/index/index/, mysite.com/index/about/ etc. How do I change this to mysite.com/index/, mysite.com/about/ etc? I know it's probably with Zend_Controller_Router_Rewrite, but I'd like an example or some help. Thanks ---------------- Now playing: Linkin Park - One Step Closer via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/121084-zend-framework-help/ Share on other sites More sharing options...
wildteen88 Posted August 24, 2008 Share Posted August 24, 2008 Set index as the default controller, (which it should be by default). mysite.com/index or mysite.com/about will call mysite.com/index/index or mysite.com/index/about Quote Link to comment https://forums.phpfreaks.com/topic/121084-zend-framework-help/#findComment-624427 Share on other sites More sharing options...
LemonInflux Posted August 26, 2008 Author Share Posted August 26, 2008 $front->setParam('useDefaultControllerAlways', true); ? Quote Link to comment https://forums.phpfreaks.com/topic/121084-zend-framework-help/#findComment-625757 Share on other sites More sharing options...
wildteen88 Posted August 26, 2008 Share Posted August 26, 2008 $front->setParam('useDefaultControllerAlways', true); ? No to set the default controller you use $front->setDefaultControllerName('index') In you your "bootstrapper" (before your call $front->dispatch()) However the above should not be necessary, as zend should call the index controller (or action) by default if its not specified in the url. To test go to mysite.com, and Zend should call the indexAction within the indexController automatically without you specifying it in the url. Quote Link to comment https://forums.phpfreaks.com/topic/121084-zend-framework-help/#findComment-626179 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.