Skip to content

Commit b4c6d07

Browse files
committed
docs: Update replace_breadcrumb_params() function to handle special words in breadcrumb links
1 parent 07082d1 commit b4c6d07

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ Sets the desired style for the breadcrumb navigation.
4141
This repository contains two helper functions that allow you to use the `Breadcrumb` class more easily in your CodeIgniter project:
4242

4343
- `render_breadcrumb()`: Renders the breadcrumb navigation through the `Breadcrumb` service.
44-
- `replace_breadcrumb_params()`: Replaces all numeric text in breadcrumb links with new parameters through the `Breadcrumb` service.
44+
- `replace_breadcrumb_params()`: Replace all numeric text in breadcrumb links, along with a set of configured special words including `create`, `edit`, and `delete`, with new parameters through the `Breadcrumb` service.
4545

4646
## Usage
4747

4848
#### `render_breadcrumb()`
4949

5050
This function renders the breadcrumb navigation through the `Breadcrumb` service.
5151

52-
Note: If the route contains "log-", the "log-" segment will be automatically ignored in the breadcrumb, ensuring a cleaner and more user-friendly navigation experience.
52+
Note: If the route contains `log-`, the `log-` segment will be automatically ignored in the breadcrumb, ensuring a cleaner and more user-friendly navigation experience.
5353

5454
To use this function, simply call `render_breadcrumb()` from your **view** where you want the breadcrumb navigation to appear. You can optionally pass a CSS class name to style the container element for the breadcrumb navigation. For example:
5555

@@ -59,7 +59,9 @@ To use this function, simply call `render_breadcrumb()` from your **view** where
5959

6060
#### `replace_breadcrumb_params()`
6161

62-
This function replaces all numeric text in breadcrumb links with new parameters through the `Breadcrumb` service.
62+
This function replaces all numeric text in breadcrumb links, along with a set of configured special words including `create`, `edit`, and `delete`, with new parameters through the `Breadcrumb` service.This is particularly useful in improving the user experience as it provides more meaningful and intuitive breadcrumb navigation.
63+
64+
Users typically interface with breadcrumbs that reflect the structure of the website or application. By replacing generic numeric values or specific technical terms (`create`, `edit`, `delete`) with more context-specific text, you can make the navigation more intuitive and user-friendly. It allows users to understand their current position and navigate back to previous pages easily.
6365

6466

6567
To use this function, simply call `replace_breadcrumb_params()` from your controller, passing in an array of new parameters. For example:
@@ -69,7 +71,7 @@ $newParams = ['Home', 'New Category', 'Product Name'];
6971
replace_breadcrumb_params($newParams);
7072
```
7173

72-
This will replace any numeric text parameters in the breadcrumb links with the corresponding values from `$newParams`.
74+
This will replace any numeric text or specially configured words such as `create`, `edit` and `delete` in the breadcrumb links with the corresponding values from `$newParams`.
7375

7476
Note that you must have already created an instance of the `Breadcrumb` class and set it up with the appropriate links before calling this function.
7577

0 commit comments

Comments
 (0)