elephpant/breadcrumb
Composer 安装命令:
composer require elephpant/breadcrumb
包简介
Breadcrumbs in an uncomplicated way. This component facilitates the way to create breadcrumbs for your website, to favor a more accessible navigation. It was designed to work very well with the Bootstrap Framework. Besides being very easy to use, it has very interesting possibilities, such as adding
README 文档
README
Breadcrumbs in an uncomplicated way. This component facilitates the way to create breadcrumbs for your website, to favor a more accessible navigation. It was designed to work very well with the Bootstrap Framework. Besides being very easy to use, it has very interesting possibilities, such as adding new separators and new CSS classes to style this interface component to your liking. The Breadcrumb Component also allows you to have access to the Array assembled to feed into other features of your system, such as a microformat, for example.
Breadcrumbs de maneira descomplicada. Este componente facilita a forma de criar breadcrumbs para o seu website, para favorecer uma navegação mais acessível. Foi projetadopara trabalhar muito bem com o Bootstrap Framework. Além de ser muito fácil de utilizar ele conta com possibilidades bem interessantes, como adicionar novos separadores e novas classes CSS para estilizar ao seu gosto este componente da interface. O Breadcrumb Component também possibilita que você tenha acesso ao Array montado para alimentar em outras features do seu sistem, como um microformato, por exemplo.
Highlights
- Add others classes CSS (adicione outras classes CSS)
- Output as array (saída em Array)
- It's possible add a other separator (possibilita adicionar outro separador de Links*)
- Compatible with Bootstrap Framework (compatível com o Framework CSS Bootstrap)
- Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)
Installation
Breadcrumb is available via Composer:
"elephpant/breadcrumb": "^1.1"
or run
composer require elephpant/breadcrumb
Documentation
For details on how to use, see a sample folder in the component directory. In it you will have an example of use for each class. It works like this:
Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. Ele funciona assim:
Set all nodes of Your Web Page:
<?php require __DIR__ . "/../vendor/autoload.php"; $breadcrumb = (new \ElePHPant\Breadcrumb\Breadcrumb(null)) ->base("https://www.sergiodanilojr.com.br", "Home") ->addCrumb("Blog", "blog") ->addCrumb("Nome do Artigo", "url-do-artigo") ->addCrumb("Comentários", "comments"); //In Your webpage you can show the breadcrum, like that echo $breadcrumb->render();
Change the links separator in the constructor method:
<?php require __DIR__ . "/../vendor/autoload.php"; $separator = "<i class='icon-angle-right'></i>"; $breadcrumb = (new \ElePHPant\Breadcrumb\Breadcrumb($separator)); //NOTEs: // The default value of the separator is null. But the Bootstrap use with the 'content' attribute the slash ("/") like a separator // The separator's of string type, therefore you can set html or just a character (example: '>>')
Choose if you want show the Home Page Name and insert a icon in the place:
<?php require __DIR__ . "/../vendor/autoload.php"; $icon = "<i class='icon-home'></i>"; $breadcrumb = (new \ElePHPant\Breadcrumb\Breadcrumb(null)); $breadcrumb->base("https://elephpant.com.br", "Home",false, $icon); //NOTE: The third param's is false for hide the name (Home) //If you want to put another class insert value in the 5th param: $class = "p-3 rounded"; $breadcrumb->base("https://elephpant.com.br", "Home",false, $icon, $class);
Insert a class in the Crumb (link):
<?php require __DIR__ . "/../vendor/autoload.php"; $class = "text-underline text-danger"; $breadcrumb = (new \ElePHPant\Breadcrumb\Breadcrumb(null)); $breadcrumb->base("https://elephpant.com.br", "Home",false, $icon) ->addCrumb("Blog", "blog", $class);
Output all nodes of your Breadcrumb as array
<?php require __DIR__ . "/../vendor/autoload.php"; $breadcrumb = (new \ElePHPant\Breadcrumb\Breadcrumb(null)) ->base("https://www.sergiodanilojr.com.br", "Home") ->addCrumb("Blog", "blog") ->addCrumb("Nome do Artigo", "url-do-artigo") ->addCrumb("Comentários", "comments"); print_r($breadcrumb->allCrumbs());
Contributing
Please see CONTRIBUTING for details.
Support
Security: If you discover any security related issues, please email sergiodanilojr@hotmail.com instead of using the issue tracker.
Se você descobrir algum problema relacionado à segurança, envie um e-mail para sergiodanilojr@hotmail.com em vez de usar o rastreador de problemas.
Thank you
Credits
- Sérgio Danilo Jr. (Developer)
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
elephpant/breadcrumb 适用场景与选型建议
elephpant/breadcrumb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 459 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「breadcrumb」 「crumb」 「elephant」 「bread」 「Sérgio Danilo Jr」 「ElePHPant」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elephpant/breadcrumb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elephpant/breadcrumb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elephpant/breadcrumb 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An extension to Semantic MediaWiki allowing to build breadcrumb links from an attributive property filter
Bundle extension that installs and loads Semantic MediaWiki and associated extensions
Breadcrumb Sinicization
This bundle generates microdata for breadcrumb.
CCDN Component Crumb Trail Bundle
统计信息
- 总下载量: 459
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-27