Laravel 4 dynamic menu: "Route::is('users/*')" not working

reikyoushin

I have a route declared as

Route::resource('users', 'UserController');

now, I am creating a dynamic menu.. but using

<li {{(Route::is('users/*'))? ' class="active"' : '';}}><a href="{{ URL::action('UserController@index') }}">Users</a></li>

doesn't return true for any case of the /users (/users, /users/{id}, etc..)

Now, what could I have missed? How do I make this work?

thanks!

Oddman

are you sure the right method to use is Route::is? I can't see this mentioned anywhere in the code. It's quite possibly you're looking for Request::is, ie:

Request::is('users/[a-z]*')

This deeper down utilizes the Str::is() function, which takes the same argument, and I'm not sure if * applies there, which is why I've given the full regular expression in this example. You can try with just using * instead of the [a-z] match as well, and see if that works.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related