I think there is a way. You can take a look at Router::connect, it accepts a
parameter Router which is a class that extends CakeRoute and you can
implement there something
and you do Router::connect('/some/complicated/link', array('controller' =>
'pages', 'action' => 'display', 'p2'), array('routeClass' =>
'OwnRouteClass'));
or something like that you have to do a little research maybe take a look in
the core files router.php where Router and CakeRoute are implemented and see
how it works
On Thu, Aug 19, 2010 at 2:54 AM, Steve Love <[email protected]> wrote:
> If you just want a simple answer to your question: Yes, there's
> probably a way. But my guess is you'd have to hack the Cake core to
> use the database for routing rather than the built-in routing class.
>
> That said, if you're editing URIs on a regular basis I wouldn't call
> that very SEO-friendly. Once you change them, URIs that were indexed
> by search engines last week would have to be marked as moved
> permanently and I don't think that will win you any points. But I may
> be mistaken about how you intend to use this functionality.
>
> Steve
>
> On Aug 18, 3:54 am, "[email protected]" <[email protected]>
> wrote:
> > Hi!
> >
> > Is there any way to create routes from a database table?
> > What I mean is this: I have a table that looks like this:
> >
> > id | link | controller | action |
> > param
> >
> ---------------------------------------------------------------------------
> -----------
> > 1 | /somepage | pages | display | p1
> > 2 | /some/complicated/link | pages | display | p2
> >
> ---------------------------------------------------------------------------
> ----------
> > where the first row (id 1) translates to:
> > Router::connect('/somepage', array('controller' => 'pages', 'action'
> > => 'display', 'p1'));
> >
> > and the second row (id 2) translates to:
> > Router::connect('/some/complicated/link', array('controller' =>
> > 'pages', 'action' => 'display', 'p2'));
> >
> > and so on. I want this functionality so I can easily edit my links
> > (for a SEO perspective).
> >
> > Thanks!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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]<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
--
Bogdan Iulian Bursuc
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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