I use HtmlHelper from CakePHP to create breadcrumbs navigation for my page...
And i set $html->getCrumbs('separator', 'Home Page')
to default.ctp
and in other views i set $开发者_如何学运维html->addCrumbs('nameLink', 'linkUrl');
All works fine!
But when I open my Home Page there is no breadcrumbs, why?
Extremely obvious answer, but does your homepage view have any calls to $html->addCrumb()
? Regardless of whether you pass "Home Page" as the second parameter to $html->getCrumbs()
, if you haven't added any crumbs in your view, $html->getCrumbs()
will output nothing.
See the method definition.
The purpose of the second parameter of $html->getCrumbs()
is to output something like "Breadcrumbs:" or "How you got here:", not to display the first of your crumbs.
精彩评论