1. Go to this page and download the library: Download geeklabs/ci4-breadcrumbs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Controllers;
use CodeIgniter\Controller;
use App\Modules\Breadcrumbs\Breadcrumbs;
class Home extends Controller{
public $breadcrumb;
public function __construct()
{
$this->breadcrumb = new Breadcrumb();
}
public function index(){
$this->breadcrumb->add('Home', '/');
$this->breadcrumb->add('Dashboard', '/dashboard');
$this->breadcrumb->add('Customer', '/dashboard/customer');
$data['breadcrumbs'] = $this->breadcrumb->render();
return view('home', $data);
}
}