Coder Social home page Coder Social logo

breadcrumb's People

Contributors

bilalq avatar dsoares avatar kiroushi avatar noherczeg avatar radarseven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

breadcrumb's Issues

Custom dictionary not loading

In Laravel 4.1, I get the breadcrumbs like this:

private function getBreadcrumbsHtml() {       
    $dictionary = array('test' => 't2');
    $bc = new \Noherczeg\Breadcrumb\Breadcrumb(URL::to('/'), $dictionary);
    $uri = Request::path();
    $bc->from($uri)->append('Home', 'left', true);       
    return $bc->build('bootstrap', 'title', true, '/');
}

However, when I go to http://mysite.com/test the html returned shows 'test', not 't2' as it should. It does work if I use the default en.php lang file ... but I'd prefer to use the custom dictionary.

Use ucwords for title casing

Currently ucfirst() is used in builder.php for title casing. It seems more appropriate to use ucwords() for a title. Or at least add another option that does.

Seperator link

How can I set a segment of the breadcrumb as a separator? I can only set the last item of the breadcrumb as no link. I want to create the breadcrumb like the example below:

Home / Services / Service 1 / Active link

Is this function already included into the package?

Provide a better project description

Congratulations, you made it to the trending repos page :) (At least yesterday, when I was starting to write this issue ;-)).

It would be nice if you could provide a better project description in your github repo settings, so people can get a better grasp in what your project does. A good example comes from your readme that describes your project very well: A package for breadcrumb management.

Adding crumb to home duplicates forward slash

Given a URL like:
http://example.com/a/b

I want my HTML to be:

<a href="/">Home</a>
<a href="/a">A</a>
<a href="/a/b">B</a>

I use the following code:

$dictionary =  Lang::get('breadcrumbs');
$uri = Request::path(); // returns: a/b
$bc = new \Noherczeg\Breadcrumb\Breadcrumb('/', $dictionary);
$bc->from($uri)->append('', 'left', true); // set base and append home URL
return $bc->build('bootstrap', 'title', true);

The result is:

<a href="/">Home</a>
<a href="//a">A</a>
<a href="//a/b">B</a>

How do I append a base url of '/' without causing the double slash for all other URLs?

URI build only from numbers

Hi,

I came across a bug, when my url is http://domain.pl/en/2222222222222222, uri consists of only numbers. I get an error:

array_values() expects parameter 1 to be array, integer given
Location:
/vendor/noherczeg/breadcrumb/src/Noherczeg/Breadcrumb/Breadcrumb.php on line 205

I found that json_decode return Int, and this breaks array_values()

Generating Links Badly

I had to swap lines 59/59 from Builders/Builder.php in order for it to generate proper url's in Laravel 4.1

$this->setNextCurrentURL($segment, $different_links);
$this->setLink($key, $segment, $position);

If i didn't do that, the url's would have been shifted by one.
This is how i did the init https://gist.github.com/CoolGoose/c50a10b2adf4676f2df1
Build is: {{ $breadcrumb->build('bootstrap', 'lower', true, '') }}

The overwritting doesn't work

I try to overwrite translation in segment using the way you explained however it doesn't work. Instead it creates a new segment with the translation I have defined while using append method.

Reminder: $this not valid in 5.4

Change $this->app, to $app.

return new Breadcrumb($this->app['request']->root(), $options);
return new Breadcrumb($app['request']->root(), $options);

Dictionary array

It seems that the option of a dictionary for an array is not working. And there's an option that I can use an address to the dictionary file? I tried to indicate an address but did not run.

Missing <li> tags in Bootstrap Builder

Create a breadcrumb and use the Bootstrap builder, it is missing opening LI tags for the separator and closing LI tags for the selected and unselected crumbs.

Laravel 4 config file ignored

Hi,

I published the config file within laravel 4

php artisan config:publish noherczeg/breadcrumb

Made some changes, but the changes don't take effect. It looks to me like you aren't ever referencing the package config file.

I was able to make it work by adding the following line to BreadCrumb\Config.php around line 47 in the value() method

    if (!is_string($key)) {
            throw new \InvalidArgumentException("Invalid argument provided, string required!");
    }
    elseif(\Config::get('breadcrumb::' . $key, false) !== false) {
            return \Config::get('breadcrumb::' . $key, false);
    }
    // as before

Doing this and removing the namespace declaration from the generated config file worked for me but not sure what effect this would have on people using it outside of laravel

Builder not supported

Unhandled Exception

Message:

Provided output format(foundation) is not supported!
Location:

/Users/alex/Sites/bothsider.dev/vendor/noherczeg/breadcrumb/src/Noherczeg/Breadcrumb/Breadcrumb.php on line 413
Stack Trace:
#0 /Users/alex/Sites/bothsider.dev/application/controllers/issue.php(135): Noherczeg\Breadcrumb\Breadcrumb->build('foundation')
#1 [internal function]: Issue_Controller->action_index('725', 'test-issue-2')
#2 /Users/alex/Sites/bothsider.dev/laravel/routing/controller.php(325): call_user_func_array(Array, Array)
#3 /Users/alex/Sites/bothsider.dev/laravel/routing/controller.php(285): Laravel\Routing\Controller->response('index', Array)
#4 /Users/alex/Sites/bothsider.dev/laravel/routing/controller.php(165): Laravel\Routing\Controller->execute('index', Array)
#5 /Users/alex/Sites/bothsider.dev/laravel/routing/route.php(153): Laravel\Routing\Controller::call('issue@index', Array)
#6 /Users/alex/Sites/bothsider.dev/laravel/routing/route.php(124): Laravel\Routing\Route->response()
#7 /Users/alex/Sites/bothsider.dev/laravel/laravel.php(167): Laravel\Routing\Route->call()
#8 /Users/alex/Sites/bothsider.dev/public/index.php(36): require('/Users/alex/Sit...')
#9 {main}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.