src/Breadcrumbs.php
public function addCrumb(string $name = '', string $href = ''): Breadcrumbs
    {
        $breadcrumb = [
            'name' => $name,
            'href' => $href
        ];
        if (!$this->validateCrumb($breadcrumb)) {
            throw new InvalidArgumentException(
                'Breadcrumbs::addCrumb() only accepts correctly formatted arrays.'
            );
        }

        $crumb = [
            'name' => $name,
            'href' => $href
        ];

        $this->breadcrumbs[] = $crumb;

        return $this;
    }
public function addCrumb(string $name = '', string $href = ''): Breadcrumbs
    {
        $breadcrumb = [
            'name' => $name,
            'href' => $href
        ];
        if (!$this->validateCrumb($breadcrumb)) {
            throw new InvalidArgumentException(
                'Breadcrumbs::addCrumb() only accepts correctly formatted arrays.'
            );
        }

        $crumb = [
            'name' => $name,
            'href' => $href
        ];

        $this->breadcrumbs[] = $crumb;

        return $this;
    }
public function addCrumb ( string $ name = '' , string $ href = '' ) : Breadcrumbs { $ breadcrumb = [ 'name' => $ name , 'href' => $ href ] ; if ( ! $ this -> validateCrumb ( $ breadcrumb ) ) { throw new InvalidArgumentException ( 'Breadcrumbs::addCrumb() only accepts correctly formatted arrays.' ) ; } $ crumb = [ 'name' => $ name , 'href' => $ href ] ; $ this -> breadcrumbs [ ] = $ crumb ; return $ this ; }
Add a crumb to the internal array.

@param string $name The name of the crumb.
@param string $href The link of the crumb.

@return \Xety\Breadcrumbs\Breadcrumbs
Add a crumb to the internal array .