Hi All,
After some searching and looking into the html crumbs helper source
code, it seems I totally misunderstood (and overestimated) the
functionality, and would just like to a) confirm I now understand
correctly now, and b) share this with any other misguided souls.
I thought that all that was needed was:
$html->addCrumb('Text', '/controller/action'); //anywhere in the view
echo $html->getCrumbs(' > ', 'Home-text"); // where I want crumbs to
appear
This works OK but only the Home-text and Text crumbs are rendered (2
crumbs). Echoing _crumbs confirms only these are in the array.
I thought that cake would automatically pick up the parent crumbs and
addCrumb would just add to that list i.e. each page only needed to add
itself to the list.
So now I :
$html->addCrumb('Parent', '/controller/actiona'); //anywhere in the
view - how to know what parent(s) to add?
$html->addCrumb('Parent1', '/controller/actionb'); //anywhere in the
view - how to know what parent(s) to add?
$html->addCrumb('Text', '/controller/action'); //anywhere in the view
echo $html->getCrumbs(' > ', 'Home-text"); // where I want crumbs to
appear - now renders 3 crumbs
This works and renders 4 crumbs.
I guess I could make this more flexible (e.g. by using referrer) but
that would just mean more testing!
So have I understood this correctly - is this the correct way to use
the helper?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---