Frontend\Core\Engine\Breadcrumb::clear PHP Method

clear() public method

Clear all (or a specific) elements in the breadcrumb
public clear ( integer $key = null )
$key integer If the key is provided it will be removed from the array, otherwise the whole array will be cleared.
    public function clear($key = null)
    {
        // key given?
        if ($key !== null) {
            // remove specific key
            unset($this->items[(int) $key]);
            // resort, to avoid shit when parsing
            $this->items = \SpoonFilter::arraySortKeys($this->items);
        } else {
            // clear all
            $this->items = array();
        }
    }