php 使用 Code Igniter 制作面包屑的最佳方法是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6494080/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:33:25  来源:igfitidea点击:

What is the best way to make a breadcrumb with Code Igniter?

phpcodeigniterbreadcrumbs

提问by zourite

I wonder what a best way to make a breadcrumb with Code Igniter.

我想知道使用 Code Igniter 制作面包屑的最佳方法是什么。

1 : Retrieve the strings with URL

1 : 检索带有 URL 的字符串

example : $this->uri->segment(2)

例子 : $this->uri->segment(2)

2 : Do you know another way ?

2:你知道另一种方式吗?

I'd really like to have your opinion

我真的很想听听你的意见

回答by Dan

Using URL segments is specific to how you have your URL structured - there is not always a 1:1 match.

使用 URL 段是特定于您的 URL 结构的 - 并不总是 1:1 匹配。

http://forum.codeigniter.com/thread-25372.html?highlight=137949

http://forum.codeigniter.com/thread-25372.html?highlight=137949

回答by Florin

If you want 100% Match and easy to customize use this one :

如果您想要 100% 匹配且易于自定义,请使用此:

https://github.com/nobuti/Codeigniter-breadcrumbs

https://github.com/nobuti/Codeigniter-breadcrumbs

Breadcrumbs is an small library that helps your manage HTML breadcrumbs with CodeIgniter.

Breadcrumbs 是一个小型库,可帮助您使用 CodeIgniter 管理 HTML 面包屑。

回答by Aaron Burdick

There are some problems with buti's Codeigniter-breadcrumbs library, particularly with the "unshift" method and how it uses Codeigniter's "site_url" method instead of giving you the option to push to breadcrumbs using "base_url". You can check out my fork, since buti's repo is no longer being maintained (since 2012): https://github.com/aburd/Codeigniter-breadcrumbs

buti 的 Codeigniter-breadcrumbs 库存在一些问题,特别是“unshift”方法以及它如何使用 Codeigniter 的“site_url”方法,而不是让您选择使用“base_url”推送到面包屑。您可以查看我的 fork,因为 buti 的 repo 不再维护(自 2012 年起):https: //github.com/aburd/Codeigniter-breadcrumbs