Re: Subdomain for Controller

2009-11-19 Thread schneimi
Hi,

you can check the subdomain in the configs/routes.php and create a
route to your controller.

$subdomain = substr(env("HTTP_HOST"), 0, strpos(env("HTTP_HOST"),
"."));

if ($subdomain == 'api') {
  Router::connect('/', array('controller' => 'api', 'action' =>
'index'));
}

Not sure if there is a better way, hope that helps anyway.

On 19 Nov., 09:35, Kyle Decot  wrote:
> How would I go about making my ApiController link to api.example.com/?
> Thanks for any insight you can provide

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




Subdomain for Controller

2009-11-19 Thread Kyle Decot
How would I go about making my ApiController link to api.example.com/?
Thanks for any insight you can provide

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.