定制 andrewdanilov/yii2-breadcrumbs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrewdanilov/yii2-breadcrumbs

Composer 安装命令:

composer require andrewdanilov/yii2-breadcrumbs

包简介

Breadcrumbs widget

README 文档

README

Widget let you create breadcrumbs in simialar way as the default yii breadcrumbs widget, but with help of template files. You can define templates separetely for wrapper, link item and for active (last) breadcrumb item.

Installation

The preferred way to install this extension is through composer.

Either run

composer require andrewdanilov/yii2-breadcrumbs "~1.0.0"

or add

"andrewdanilov/yii2-breadcrumbs": "~1.0.0"

to the require section of your composer.json file.

Usage

<?= andrewdanilov\breadcrumbs\Breadcrumbs::widget([
	'templateWrapper' => '@frontend/views/site/breadcrumbs/wrapper', // optional
	'templateItem' => '@frontend/views/site/breadcrumbs/item', // optional
	'templateActiveItem' => '@frontend/views/site/breadcrumbs/active-item', // optional
	'showHome' => false, // optional, default true
	'homeLabel' => 'Main', // optional, default 'Main'
	'homeUrl' => ['site/index'], // optional, default ['/']
	'showActiveItemUrl' => true, // optional, default false
	'hideIfSingleItem' => false, // optional, default true. Hides widget if the only element presents in items array. If showHome is true, then home page counts as first element.
	'microdata' => true, // optional, default false
	'items' => [
		['label' => 'Category', 'url' => ['site/category']],
		['label' => 'Subcategory', 'url' => ['site/subcategory']],
		'Product #1', // short form of ['label' => 'Product #1']
	],
]) ?>

You can use own templates for breadcrumbs wrapper element, list items and active list item. Just copy example templates from /vendor/andrewdanilov/yii2-breadcrumbs/views to your prefered directory. Modify them as you need and define correspond paths to their location: templateWrapper, templateItem, templateActiveItem.

You can enable schema.org microdata for breadcrumbs by setting microdata option to true.

统计信息

  • 总下载量: 49
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固