m-adamski/symfony-breadcrumbs-bundle
Composer 安装命令:
composer require m-adamski/symfony-breadcrumbs-bundle
包简介
The Symfony Bundle, which simplifies the process of generating and displaying breadcrumbs
README 文档
README
The Symfony Bundle, which simplifies the process of generating and displaying breadcrumbs. Compared to previous versions, this one is based on simple methods of creating and adding breadcrumbs.
Installation
Composer can install this bundle:
$ composer require m-adamski/symfony-breadcrumbs-bundle
How to use it?
namespace App\Controller; use App\Model\Breadcrumbs\Breadcrumb; use App\Model\Breadcrumbs\Catalog as BreadcrumbsCatalog; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; class DashboardController extends AbstractController { public function __construct( private readonly BreadcrumbsCatalog $breadcrumbsCatalog, ) {} #[Route("/dashboard", name: "dashboard", methods: ["GET"])] public function index(): Response { $this->breadcrumbsCatalog->getDefaultContainer() ->add((new Breadcrumb("Dashboard"))->setRoute("dashboard")); return $this->render("modules/Dashboard/index.html.twig"); } }
The custom Twig function is responsible for displaying breadcrumbs:
<section class="breadcrumbs-container"> {{ breadcrumbs() }} </section>
License
MIT
统计信息
- 总下载量: 970
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-23