Sure you can,
If you want to do that you need to read all the params (func_get_args)
and make your custom logic.
I took this code from the bakery in order to do this example. Hope
this helps:
function display() {
if (!func_num_args()) {
$this->redirect('/');
}
$path=func_get_args();
if (!count($path)) {
$this->redirect('/');
}
$count =count($path);
$page =null;
$subpage=null;
$title =null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title = ucfirst($path[$count - 1]);
}
$this->set('page', $page);
$this->set('subpage', $subpage);
$this->set('title', $title);
$this->render(join('/', $path));
}
On Apr 19, 8:56 am, Kyle Decot <[email protected]> wrote:
> I want to build a forum for my website but I have a question about the
> URL structure. I want it to be something like:
>
> example.com/forum/top-category/sub-category-1/sub-category-2/..
> (etc).../thread-name/
>
> How would I do this in the routes file? Any thoughts?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---