An easy way to do it is setup a catch all route:

Router::connect('/*', array('controller' => 'MyPages', 'action' => 'show'));

But remember to define _before_ it a route for each controller in your app. Ex:

Router::connect('/users/:action/*', array('controller' => 'users'));
...

HTH,
- Dardo Sordi.

On Fri, Feb 15, 2008 at 6:52 AM, Voyager2K <[EMAIL PROTECTED]> wrote:
>
>  Lets i post my look at this implementation:
>  adding to dispatch one more condition if (!is_object($controller))
>
>  dispatcher.php
>
>         function dispatch($url = null, $additionalParams = array()) {
>                 if ($this->base === false) {
>                         $this->base = $this->baseUrl();
>                 }
>                 if ($url !== null) {
>                         $_GET['url'] = $url;
>                 }
>
>                 $url = $this->getUrl();
>                 $this->here = $this->base . '/' . $url;
>
>                 if ($this->cached($url)) {
>                         exit();
>                 }
>
>                 $this->params = array_merge($this->parseParams($url),
>  $additionalParams);
>
>                 $controller = $this->__getController();
>
>                 // HANDLE DB TREE
>                 if (!is_object($controller)) {
>                         $_GET['url'] = 'sitepages/index/'.$_GET['url'];
>                         $url = $this->getUrl();
>                         $this->here = $this->base . '/' . $url;
>
>                         if ($this->cached($url)) {
>                                 exit();
>                         }
>                         $this->params = array_merge($this->parseParams($url),
>  $additionalParams);
>                         $controller = $this->__getController();
>
>
>                 }
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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