:any under domain root

edited January 2012 in Share

I was wondering what the preferred method would be for setting up a site for handling this structure:

** with other controllers and opt in controllers, such as /contact, /cart, /etc

Should I be making changes to the /views/_variables/global.php, /config/routing.php, both, or somewhere else?

I was thinking something like this in global.php:

$pages[':any'] = array('view' => 'brand');
$pages[':any/:any'] = array('view' => 'model');
$pages['customer-service'] = array('view' => 'customer-service');
** /contact works fine as is because it a controller, which takes precedence.

If the above is the preferred method, what would I use to make sure the route goes correctly to the home view,
tried :
$pages[''] = array('view'=> 'home');
but doesn't seem to work with the current configuration.

Thanks v much.


  • edited 11:31AM
    Perhaps you could try something like this:
    if (!is_home()) { $pages[':any'] = array('view' => 'brand'); $pages[':any/:any'] = array('view' => 'model'); $pages['customer-service'] = array('view' => 'customer-service'); }
  • edited 11:31AM
    sweet, thanks. simple solution in the end. :D
Sign In or Register to comment.