PHP code example of rikiless / breadcrumb-component

1. Go to this page and download the library: Download rikiless/breadcrumb-component 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/ */

    

rikiless / breadcrumb-component example snippets


class Presenter ...
{

    /**
     * @var Rikiless\BreadcrumbComponent\IControl
     * @inject
     */
    public $breadcrumbControl;

    public function createComponentBreadcrumb()
    {
        return $this->breadcrumbControl->create();
    }

}

class CatalogPresenter ...
{

    public function actionEpisode($id)
    {
        //$episode = ...($id);

		$this['breadcrumb']
			->add('Series', $this->link('Homepage:genres'))
			->add($episode->show->name, $this->link('Homepage:show', $episode->show->url))
			->add('All episodes', $this->link('Homepage:episodes', $episode->show->url))
			->add($episode->show->name);
    }

}

class Presenter ...
{

    public function createComponentBreadcrumb()
    {
        $breadcrumb = $this->breadcrumbControl->create();
        $breadcrumb->setTemplate(__DIR__. '/../templates/_breadcrumb.latte');
        return $breadcrumb;
    }

}