A common piece of HTML that is present in many web applications is the breadcrumbs. These are links separated by a space or by the
/ character usually, that represent the tree structure of an application. The purpose is to give users another easy visual way to navigate throughout the application.
An example is an application that has an
admin module, an
invoices area, and a
view invoice page. Usually, you would select the
admin module, then from the links you will choose
invoices (list), and then clicking on one of the invoices in the list, you can view it. To represent this tree-like structure, the breadcrumbs displayed could be:
Phalcon\Html\Breadcrumbs offers functionality to add text and URLs. The resulting HTML when calling
render() will have each breadcrumb enclosed in
<dt> tags, while the whole string is enclosed in
In the example below, add a crumb with a link and then add a crumb without a link (normally the last one)
In the example below remove a crumb by URL and also remove a crumb without an URL (last link)
<dt></dt> tags. The whole collection is wrapped in
<dl></dl> tags. You can use them in conjunction with CSS to format the crumbs on screen according to the needs of your application.
/. You can set a different one if you wish using this method.