Download the PHP package ictsolutions/codeigniter-breadcrumbs without Composer

On this page you can find all versions of the php package ictsolutions/codeigniter-breadcrumbs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codeigniter-breadcrumbs

Codeigniter Breadcrumbs

The CodeIgniter Breadcrumb Library assists in generating and rendering breadcrumb navigation based on the current URL segments. It is specifically designed to seamlessly integrate with the CodeIgniter framework. This library simplifies the process of creating breadcrumb navigation by automatically tracking the user's navigation path within your application. It dynamically generates the breadcrumb trail based on the current URL segments, making it effortless to implement and maintain.

PHP CodeIgniter

Installation

Installation is done through Composer.

Configuration

The library's default behavior can be overridden or augmented by its config file. Copy examples/Breadcrumb.php to app/Config/Breadcrumb.php and follow the instructions in the comments. If no config file is found the library will use its default. In the Breadcrumb class, you can set the following configuration options:

$isTranslatable

Specifies whether the breadcrumbs will be translatable or not. If set to true then inside the Language folder, create a new file named Breadcrumb.php. This will be the language file for your breadcrumbs.

$includeHome

Determines whether the home page should be included in the breadcrumb trail. Setting it to true includes the home page in the breadcrumbs, enhancing navigation, while setting it to false excludes it from the breadcrumb trail.

$style

Sets the desired style for the breadcrumb navigation.

Helpers

This repository contains two helper functions that allow you to use the Breadcrumb class more easily in your CodeIgniter project:

Usage

render_breadcrumb()

This function renders the breadcrumb navigation through the Breadcrumb service.

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.

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:

replace_breadcrumb_params()

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.

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.

To use this function, simply call replace_breadcrumb_params() from your controller, passing in an array of new parameters. For example:

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.

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.

Example: Creating a CodeIgniter Project with Breadcrumbs

To create a CodeIgniter project with breadcrumbs, follow these steps:

  1. Initialize a new CodeIgniter project by running the following command in your terminal or shell:

This will create a new CodeIgniter project named "ci4-breadcrumbs" using the CodeIgniter 4 starter template.

  1. Install the breadcrumbs library by running the following command in your terminal or shell:

This will install the "ictsolutions/codeigniter-breadcrumbs" library into your project.

  1. In the Home controller of your CodeIgniter project, add two new methods: foo() and bar(). You can add these methods to the existing Home controller file (app/Controllers/Home.php). Here is an example of how to add the methods:

Copy new methods directly:

  1. In the Routes configuration file (app/Config/Routes.php), add two new routes for the foo() and bar() methods. Here is an example of how to add the routes:

Copy new routes directly:

  1. In the Views folder of your CodeIgniter project, create a new view file named foo-bar.php and add the following content to it:

This view file contains HTML markup with Bootstrap CSS and JavaScript included. It also includes a call to the render_breadcrumb() function, which you can customize as per your requirements.

  1. Inside the Language folder, create a new file named Breadcrumb.php. This will be the language file for your breadcrumbs. Open the Breadcrumb.php file and add your breadcrumb translations using the CodeIgniter language array format. For example:

This is an example of the English translation for the breadcrumbs. You can create additional files for different languages or modify the existing file to add translations in different languages.

  1. Finally, run:

Now you can visit http://localhost:8080/foo/bar in your web browser to see the result. This URL will trigger the bar() method in the Home controller and display the foo-bar.php view with the Bootstrap styling and the breadcrumb content.

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of codeigniter-breadcrumbs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ictsolutions/codeigniter-breadcrumbs contains the following files

Loading the files please wait ...