HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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>&nbsp;&nbsp;/&nbsp;&nbsp;';
        $this->_count++;
    }
}