Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2008, 10:05 PM
Junior Member
 
Join Date: Dec 2007
Posts: 3
Default Help with routes needed...

I'm trying to create a site and I want to forward to various "sub" sites based on a parameter in the URL instead of just using modules, as pretty much all the code (with the exception of some front end styles) will remain the same for the sites (only data/content will change).

Maybe an example will be easier to understand what I'm trying to do:

Conditions:
1) domain.com/ should point to Index controller / Index action
2) domain.com/site/ should point to Index controller / "site" should be passed as name param
3) domain.com/site/page should point to Page controller / "site" should be passed as name param

So basically instead of being in domain.com/controller/action/param format I need it in domain.com/param/controller/action... I basically want the same set of controllers to handle all the various sites and just spit out the different data from the db based on the site name...

Possible?

- Aaron
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-16-2008, 08:20 PM
Junior Member
 
Join Date: May 2008
Posts: 12
Default

Try something like this (using Zend_Config_Ini... code would go in your ini file)
1) domain.com/ Will work out of the box
2) domain.com/site/
Code:
routes.site.route = ":name"
Will default to index action, index controller. Inside your controller:
PHP Code:
$this->_getParam('name'
will equal 'site'

3) domain.com/site/page
Code:
routes.sitePage.route = ":name/:controller"
Will default to index action, and whatever controller is specified in the URL.

You may also have to define
Code:
routes.sitePageAction.route = ":name/:controller/:action"
routes.sitePageActionParams.route = ":name/:controller/:action/*"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:14 PM.