Not sure if this is entirely what you want, but the constant FULL_BASE_URL is available to give you the sites URL such as www.mysite.com
On Jul 3, 3:31 pm, Tilen Majerle <[email protected]> wrote: > try with Router::url('/', true); > -- > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > 2011/7/3 Jerin <[email protected]> > > > > > > > > > Hi , how to get site url in controller and view.The same built in > > function available in CI.My objective is to get "localhost/ > > project_name" in development mode and "domainname.com" in production > > in both view and controller. Is it possible in Cake. > > I can write like this. > > > $data = explode('/',$_SERVER['REQUEST_URI']); > > echo $_SERVER['SERVER_NAME']."/".$data['1']; > > But i think this is not a better way.. > > > Thanx in advance. > > > -- > > Our newest site for the community: CakePHP Video Tutorials > >http://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
