Notice: Undefined offset: 8192 in /home/miphpf/domains/miphpf.com/public_html/includes/common.inc on line 499

Notice: Undefined offset: 8192 in /home/miphpf/domains/miphpf.com/public_html/includes/common.inc on line 506

Warning: Incorrect key file for table './miphpf_miphpfcom/watchdog.MYI'; try to repair it query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/miphpf/domains/miphpf.com/public_html/includes/unicode.inc on line 291.', 2, '', 'http://www.miphpf.com/manual/breadcrumb.html', '', '3.238.112.198', 1716791581) in /home/miphpf/domains/miphpf.com/public_html/includes/database.mysql.inc on line 121
Breadcrumb | MIPHPF - Your Open Source RAD PHP Framework
Skip navigation.
Home

Breadcrumb

: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/miphpf/domains/miphpf.com/public_html/includes/unicode.inc on line 291.

miBreadcrumb class is designed to ease the creation of breadcrumb navigation. Page locations and names are mapped in the $_pageNames variable within the derived class. The tree structure of the pages is mapped in the $_pages variable. Separator can be changed through the value of $_separator variable within the class or runtime. The template of each entry can be changed to get a custom look and feel for each breadcrumb node.

* Using the miBreadcrumb class

<?php
class Breadcrumb extends miBreadcrumb
{
   
public function __construct()
    {
       
// Map all pages and their corresponding names
       
$this->_pageNames = array(
           
'/admin/' => 'Home',
           
'/admin/administrators.php' => 'Administrators',
           
'/admin/categories.php' => 'Categories',
        );
    }
   
   
// Map page structure
   
protected $_pages = array(
       
'/admin/' => array(
           
'/admin/administrators.php',
           
'/admin/categories.php',

        )
    );

   
// Override the default separator
   
protected $_separator = '<img src="/skins/default/admin/images/pointer_right.gif" />';

   
// Override the default link template
   
protected $_linkTemplate = '<a href="%%LINK%%?action=dmBack" class="navy">%%NAME%%</a>';
}

$breadcrumb = new Breadcrumb();

// You can override separator runtime if needed
$breadcrumb->setSeparator('&gt;&gt;');
// You can change the link template runtime if needed
$breadcrumb->setLinkTemplate('<a href="%%LINK%%">%%NAME%%</a>');

// Get the breadcrumb html
$breadcrumbHtml = $breadcrumb->getBreadcrumbHtml('/admin/administrators.php');

// $breadcrumbHtml now holds:
// <a href="/admin/">Home</a> &gt;&gt; <a href="/admin/administrators.php">Administrators</a>

// Will output: Home >> Administrators
print($breadcrumbHtml);
?>