PHP Class PHPFusion\BreadCrumbs

Get instances by keys:

Hide the home of $bcCustom hideHome();

Set the last breadcrumb clickable (it is rendered as a simple text by default) setLastClicklable();

You can override the default CSS classes of the wrapper HTML node $bcCustom->setCssClasses('breadcrumb-custom');

Be careful! If you want to add a new class, use this method addCssClasses('additional-class1 additional-class2');

Get the items as associative arrays toArray(); $itemsCustom = $bcCustom->toArray();

显示文件 Open project: php-fusion/PHP-Fusion Class Usage Examples

Public Methods

Method Description
__construct ( )
addBreadCrumb ( array $link ) : static Add a link to the breadcrumb
addCssClasses ( string $classes ) : static
getCssClasses ( ) : string
getInstance ( string $key = 'default' ) : static Get an instance by key
hideHome ( ) : static Hide the link to home page
isHomeShown ( ) : boolean
isLastClickable ( ) : boolean
setCssClasses ( string $classes ) : static
setLastClickable ( boolean $clickable = TRUE ) : static
showHome ( boolean $state = TRUE ) : static Show or hide the link to home page
toArray ( ) : array Get breadcrumbs

Method Details

__construct() public method

public __construct ( )

addBreadCrumb() public method

Add a link to the breadcrumb
public addBreadCrumb ( array $link ) : static
$link array Keys: link, title
return static

addCssClasses() public method

public addCssClasses ( string $classes ) : static
$classes string
return static

getCssClasses() public method

public getCssClasses ( ) : string
return string

getInstance() public static method

Get an instance by key
public static getInstance ( string $key = 'default' ) : static
$key string
return static

hideHome() public method

Hide the link to home page
public hideHome ( ) : static
return static

isHomeShown() public method

public isHomeShown ( ) : boolean
return boolean

isLastClickable() public method

public isLastClickable ( ) : boolean
return boolean

setCssClasses() public method

public setCssClasses ( string $classes ) : static
$classes string
return static

setLastClickable() public method

public setLastClickable ( boolean $clickable = TRUE ) : static
$clickable boolean
return static

showHome() public method

Show or hide the link to home page
public showHome ( boolean $state = TRUE ) : static
$state boolean
return static

toArray() public method

Get breadcrumbs
public toArray ( ) : array
return array Keys of elements: title, link