File: D:/HostingSpaces/SBogers10/tops.komma.pro/wwwroot/lib/content/breadcrumb.class.php
<?php
/**
* breadcrump.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 13/02/14
*/
class Breadcrumb
{
private $_output;
private $_count = 0;
public function __construct(){}
/*
* Return breadcrumb to the user
*/
function get()
{
// Get rid of last arrow
$this->_output = substr($this->_output,0,-25);
// close up
for($i=0;$i< $this->_count;$i++)
{
$this->_output .= '</span>';
}
return $this->_output;
}
/*
* Add Url to the breadcrumb
*/
public function add($url, $title)
{
$this->_output .= '<span ';
if($this->_count > 0) $this->_output .= 'itemprop="child" ';
$this->_output .= 'itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a itemprop="url" href="' . $url . '"';
if($url == $_SERVER['REQUEST_URI']) $this->_output .= ' class="active"';
$this->_output .= '>
<span itemprop="title">' . $title .'</span>
</a> / ';
$this->_count++;
}
}