开发者

Breadcrumbs in CakePHP

开发者 https://www.devze.com 2022-12-26 15:58 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消