<?php

/**
 * Breadcrumb.php
 *
 * @copyright  2017 damicms.com - All Rights Reserved
 * @link       http://www.baidu.com
 * @author     Sam Chen <samchen@damicms.com>
 * @created    2017-12-25 10:18
 * @modified   2017-12-25 10:18
 */
class Breadcrumb
{
    private $data = array();

    public function addHome()
    {
        $this->add(t('text_home'), url()->link('common/home'));
    }

    public function add($text, $href)
    {
        if (empty($text) || empty($href)) {
            return;
        }
        $this->data[] = array(
            'text' => $text,
            'href' => $href
        );
    }

    public function all()
    {
        return $this->data;
    }
}
