Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Add arbitrary data to breadcrumbs #35

Closed
d13r opened this issue Jun 6, 2014 · 2 comments
Closed

Add arbitrary data to breadcrumbs #35

d13r opened this issue Jun 6, 2014 · 2 comments

Comments

@d13r
Copy link
Owner

d13r commented Jun 6, 2014

e.g. breadcrumbs.php:

$breadcrumbs->push($title, $url, ['icon' => 'sample.png']);

Custom template:

<img src="{{{ $breadcrumb->options['icon'] }}}">
@levacic
Copy link
Contributor

levacic commented Oct 25, 2014

I'm also interested in this (as well as the other people who have already asked for similar things in different issues, e.g. custom icons) - wouldn't it be as simple as replacing this code with the following:

    public function push($title, $url = null, array $options = array())
    {
        $this->breadcrumbs[] = (object) array(
            'title' => $title,
            'url' => $url,
            'options' => $options,
            // These will be altered later where necessary:
            'first' => false,
            'last' => false,
        );
    }

Basically, just add the third argument, and pass it into the breadcrumb. Or are there any problems that this would cause?

@d13r
Copy link
Owner Author

d13r commented Oct 25, 2014

Looks about right. Feel free to turn it into a PR. Cheers.

levacic added a commit to levacic/laravel-breadcrumbs that referenced this issue Oct 25, 2014
levacic added a commit to levacic/laravel-breadcrumbs that referenced this issue Oct 25, 2014
levacic added a commit to levacic/laravel-breadcrumbs that referenced this issue Oct 25, 2014
@d13r d13r closed this as completed in #56 Oct 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants