[eluser]rbnc[/eluser]
Hi everyone,
I've got a question about re-routing a request from a controller.
What I'd like to do is
Code:
class Cats extends Controller {
function Cats()
{
parent::Controller();
}
function view($some_id)
{
$this->reroute('/dogs/view/'.$some_id);
}
}
So when I go to cats/view/123 I will get dogs/view/123 without being redirected.
I know this probably seems ridiculous but the purpose is as follows.
/cats/view/123 and similar URIs obviously isn't all that SEO friendly, so with the CMS there is field where the customer can input a 'fake' uri something like 'cats/purring/beautiful-black-furry-cat' which when visited will route to an SEO controller which looks up cats/purring/beautiful-black-furry-cat from a look up and returns /cats/view/123 which is then called.
The bit I'm stuck at is re-routing to the returned real uri '/cats/view/123'.
The problem could obviously be very easily solved by just putting my cats::view code in the method but I would like to be able to map to multiples controllers and methods. So /dogs/category/123 could be mapped to /black-labradors.
Anyway, my question really is can I reroute to a different controller and method using a string which represents the 'real' uri?
Thanks in advance