Code Monkey home page Code Monkey logo

ci-breadcrumb's Introduction

CI-Breadcrumb

Breadcrumb library for CodeIgniter 3.x.x

Demo

You can see the demo that online at this address: https://demo.domprojects.com/ci-breadcrumb/

Breadcrumb

Installation

CodeIgniter

  1. Download CodeIgniter 3.x.x
  2. Unpack the archive
  3. Copy the contents of the uncompressed archive to the root of your site or copy the directory of the uncompressed archive to the root of your site
./
|_ application
|_ system
|_ index.php

OR

./
|_ CI-Breadcrumb
  |_ application
  |_ system
  |_ index.php

Librairie CI-Breadcrumb

  1. Download the archive
  2. Unpack the archive
  3. Copy the contents of the uncompressed archive to your site
./
|_ application
  |_ controllers
    |_ Test_breadcrumb.php
  |_ libraries
    |_ Breadcrumb.php
  |_ views
    |_ test_breadcrumb.php
|_ system
|_ index.php

OR

./
|_ CI-Breadcrumb
  |_ application
    |_ controllers
      |_ Test_breadcrumb.php
    |_ libraries
      |_ Breadcrumb.php
    |_ views
      |_ test_breadcrumb.php
  |_ system
  |_ index.php

Utilisation

Folder controllers

Your controller file contents with the default style:

// Load library breadcrumb
$this->load->library('breadcrumb');

// Add items
$breadcrumb_items = [
  'Dashboard' => '/',
  'Users' => 'users',
  'Add' => 'users/add'
];
$this->breadcrumb->add_item($breadcrumb_items);

// Generate breadcrumb
$this->data['content_breadcrumb'] = $this->breadcrumb->generate();

With a style customization (for the example with Bootstrap):

// Load library breadcrumb
$this->load->library('breadcrumb');

// Custom style
$template = [
  'tag_open' => '<ol class="breadcrumb">',
  'crumb_open' => '<li class="breadcrumb-item">',
  'crumb_active' => '<li class="breadcrumb-item active" aria-current="page">'
];
$this->breadcrumb->set_template($template);

// Add items
$this->breadcrumb->add_item($breadcrumb_items);

// Generate breadcrumb
$data['breadcrumb_bootstrap_style'] = $this->breadcrumb->generate();

Folder views

File contents test_breadcrumb.php :

<?php echo $content_breadcrumb; ?>

Result

Default style (without style)

1. Dashbord
2. Users
3. Add

Bootstrap style

Dashbord / Users / Add

ci-breadcrumb's People

Contributors

domprojects avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.