> I can not pass the id into the controller in this case. I also can't
> use a findall or findallbyname since the names of a category might not
> be unique. I need to be able to handle an url like the following
> examples. All of them.
>
> domain.ext/categories/books/
> domain.ext/categories/books/programming
> domain.ext/categories/programming/
> domain.ext/categories/software/
> domain.ext/categories/software/product/
> domain.ext/categories/software/product/downloads
> domain.ext/categories/software/product/reviews
this shouldn't be a problem. you just need to split the args in the
categories index () function. You then build you complexity in there,
perhaps limiting your depth to 4 /cat/subcat/subsubcat/id ?
have a look at the display method of the PagesController (in cakephp
core), as this is built to handle a 2 level structure, it shouldn't be
much hassle to extend it (a pseduo version below):
function index()
{
$arrCats = func_get_args();
// main cat
$category = $arrCats[0];
if (!empty($arrCats[1]))
{
$subCategory = $arrCats[1];
}
}
Also, if done correctly, I see no reason why you should need to use
custom SQL, find and findall should be more than adequate provided
your associations have been set correctly.
hth
jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---