I tried this one: http://snook.ca/archives/cakephp/static_pages_cakephp12/

It did not work.  I saved the file in app/error.php and it didn't seem
to effect a thing.  I had a test.ctp vew in both the /views and /views/
pages directory (I wasn't sure where it was supposed to be so I tried
both) and they did not load.

So then I tried this method: 
http://bakery.cakephp.org/articles/view/taking-advantage-of-the-pages-controller
It works!  Someone commented though that it will mess up admin routing
(haven't learned what that is yet).  So I am not sure if I should
search for a different method.  Does anyone know any good ones?  That
does not require a route for each static page?

On Jun 1, 8:51 am, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> This may be worth reading:
>
> http://bakery.cakephp.org/articles/view/custom-urls-from-the-site-roothttp://bakery.cakephp.org/articles/view/taking-advantage-of-the-pages...http://snook.ca/archives/cakephp/static_pages_cakephp12/
>
> Regards,
> - Dardo Sordi.
>
> On Sat, May 31, 2008 at 2:00 PM, Turnquist, Jonah <[EMAIL PROTECTED]> wrote:
>
> > Hey I'm just starting to learn cakephp and have a question...  I was
> > wondering what the best way to handle static pages and the home page
> > is.  This is what I've done:
>
> > In the routes file I added:
> > Router::connect('/', array('controller' => 'pages'));
>
> > And I commented out these two lines:
> > //Router::connect('/', array('controller' => 'pages', 'action' =>
> > 'display', 'home'));
> > //Router::connect('/pages/*', array('controller' => 'pages', 'action'
> > => 'display'));
>
> > So now the top directory (the home page) routes to PagesController-
> >>index(); and it uses the view pages/index.ctp
> > Furthermore if I want a static /about page I create the route:
> > Router::connect('/about', array('controller' => 'pages/about'));
> > And now /about routes to PagesController->about(); and uses the view
> > at pages/about.ctp
>
> > Using this method I have to create a new route for every static page
> > as well as add an event for each static page in the PagesController.
>
> > Is this the best method or is there a better way?  I feel like I just
> > made this way of doing static pages up and it's not the way they are
> > meant to be handled.
>
> > Also on an unrelated note, how do I find threads that I previously
> > made in google groups?  Yesterday I made a new post and it took 6
> > hours to appear.  And to see if it had any replies I have to search
> > through the Topic list
>
> > Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to