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(end($path) == 'Something')
{
$this->setAction('Something');
exit();
}
if (!count($path))
<--snip-->
The last lines of router.php look like this:
* ...and connect the rest of 'Pages' controller's urls.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action'
=> 'display'));
Router::connect('/', array('controller' => 'portal', 'action' =>
'index', 'home'));
All the other controllers behave as expected.
It works. The website is http://www.univerd.com (it's in Catalan/
Spanish)(and I didn't do the visual design)
On Jan 19, 10:36 pm, Gonzalo Servat <[email protected]> wrote:
> On Mon, Jan 19, 2009 at 7:21 PM, leo <[email protected]> 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. No lookup for page names needed.
> > You might even be able to do a Router::connect('/*',......
>
> This isn't quite what I need as it makes any request for /controller/action
> also go to the pages controller (which is great for static pages but not if
> you have some non-static pages in controllers). If you managed to do it, I'd
> love to see your solution.
>
> - Gonzalo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---