Re: Solution for static page with no "pages" in URL

2009-01-20 Thread Gonzalo Servat
On Tue, Jan 20, 2009 at 4:39 PM, teknoid wrote: > > This is a simple solution, that I prefer. > > I ensure that all links to static pages point to .html file > > So our link: > www.example.com/pages/about_us > > Becomes: > www.example.com/about_us.html (i.e. echo $thml->link('About Us', '/ >

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread teknoid
This is a simple solution, that I prefer. I ensure that all links to static pages point to .html file So our link: www.example.com/pages/about_us Becomes: www.example.com/about_us.html (i.e. echo $thml->link('About Us', '/ about_us.html'); ) Then a single route takes care of the rest (for

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread Jon Bennett
Hi leo, > And that is what it does. Go to http://univerd.com/mantenimiento-jardin > . That is a pages page. Nothing is specifically defined for that page. ok - but how!? the routes you provided do not have an asterix after the first trailing slash, so how is cake getting the value from the url

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread leo
And that is what it does. Go to http://univerd.com/mantenimiento-jardin . That is a pages page. Nothing is specifically defined for that page. On Jan 20, 7:00 pm, "Jon Bennett" wrote: > Hi Leo, > > >  Router::connect('/pages/*', array('controller' => 'pages', 'action' > >  => 'display')); > > It

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread Gonzalo Servat
On Tue, Jan 20, 2009 at 4:00 PM, Jon Bennett wrote: > > Hi Leo, > > > Router::connect('/pages/*', array('controller' => 'pages', 'action' > > => 'display')); > > It's the above route he's trying to avoid. He wants to have: > > Router::connect('/*', array('controller' => 'pages', 'action'=> > 'd

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread Jon Bennett
Hi Leo, > Router::connect('/pages/*', array('controller' => 'pages', 'action' > => 'display')); It's the above route he's trying to avoid. He wants to have: Router::connect('/*', array('controller' => 'pages', 'action'=> 'display')); but you can't do that unless you create a route for all yo

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread leo
This fragment from PagesController::display() handles specific actions: <--snip--> $path = func_get_args(); // Clumsy, but I couldn't find a better solutio in the time available. if(end($path) == 'SendEmail') { $this->SendEmail(); exit(); } if(

Re: Solution for static page with no "pages" in URL

2009-01-20 Thread Jesse
I like all the suggestions you guys made. These are the suggestions I was looking for! I'll take these into consideration and work on it a little. I like the idea of dropping things into bootstrap to automatically be run. I'll put something up in the next couple days. -Jesse On Jan 19, 3:36 p

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Gonzalo Servat
On Mon, Jan 19, 2009 at 7:21 PM, leo wrote: > > Ahh..you didn't say that. Seems to me all you need to do is put the > pages in ..er.. pages and make sure that the pages route is last in > the routes.php file. That way everything that has a home will find it > and the rest falls through to pages.

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread leo
Ahh..you didn't say that. Seems to me all you need to do is put the pages in ..er.. pages and make sure that the pages route is last in the routes.php file. That way everything that has a home will find it and the rest falls through to pages. No lookup for page names needed. You might even be able

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Jon Bennett
hi Jesse, > I was looking for a way to circumvent putting a "Router::connect" > for each static page I have. Some of my sites have 100-150 static > pages. I'm looking for a way to dynamically build the routes for all > the pages. > > My script I wrote does work, I was just looking for in

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Jon Bennett
hi Jesse, > I was looking for a way to circumvent putting a "Router::connect" > for each static page I have. Some of my sites have 100-150 static > pages. I'm looking for a way to dynamically build the routes for all > the pages. > > My script I wrote does work, I was just looking for in

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Gonzalo Servat
On Mon, Jan 19, 2009 at 6:48 PM, leo wrote: > > Are your static pages html or PHP? Either way, why can't you just put > them in webroot? They only need to be inside the cake structure if > they're cake files. > That means I can't take advantage of the CakePHP helpers and such ... besides, if the

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread leo
Are your static pages html or PHP? Either way, why can't you just put them in webroot? They only need to be inside the cake structure if they're cake files. Jesse wrote: > I know this comes up a lot. I've always fixed this before (1.1) with a > core hack. I thought that as I moved my sites to 1.2

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Gonzalo Servat
On Mon, Jan 19, 2009 at 6:09 PM, Jesse wrote: > > Thanks both of you for your input. > > All my mod_rewrite stuff is working properly. > > I was looking for a way to circumvent putting a "Router::connect" > for each static page I have. Some of my sites have 100-150 static > pages. I'm looking

Re: Solution for static page with no "pages" in URL

2009-01-19 Thread Jesse
Thanks both of you for your input. All my mod_rewrite stuff is working properly. I was looking for a way to circumvent putting a "Router::connect" for each static page I have. Some of my sites have 100-150 static pages. I'm looking for a way to dynamically build the routes for all the pages.

Re: Solution for static page with no "pages" in URL

2009-01-16 Thread brian
In addition to clarkphp's comment, if you have static files inside directories, ie. views/pages/about/foo.ctp Router::connect('/about', array('controller' => 'pages', 'action' => 'display', 'about/index')); Router::connect('/about/*', array('controller' => 'pages', 'action' => 'display', 'about')

Re: Solution for static page with no "pages" in URL

2009-01-16 Thread clarkphp
Jesse, Are you wanting to access static pages without seeing the word "pages" in the URL? You could edit app/config/routes.php to have lines like this in it: Router::connect('/about', array('controller' => 'pages', 'action' => 'display', 'about')); Router::connect('/join', array('controller' => '

Solution for static page with no "pages" in URL

2009-01-16 Thread Jesse
I know this comes up a lot. I've always fixed this before (1.1) with a core hack. I thought that as I moved my sites to 1.2 now I would come up with a little better solution. I'm not sure if this is the best solution but it works for me. I want others thoughts and opinions for this solution. THE