letrunghieu / active

The helper class for Laravel applications to get active class base on current route
https://www.hieule.info/tag/laravel-active/
MIT License
414 stars 82 forks source link

Update Active.php to match behavior of documentation #12

Closed mattrandallbecker closed 9 years ago

mattrandallbecker commented 9 years ago

Specifically these lines

Return string 'active' if current route lead to the method 'getFoo' of the class 'FooController' Active::action('FooController@getFoo');

Return string 'selected' if current route lead to the method 'getFoo' of the class 'FooController' or the method 'postBar' of the class 'BarController' Active::action(array('FooController@getFoo', 'BarController@postBar'), 'selected');

It appears in laravel 5 $this->_router->currentRouteAction(); returns the full path to the controller so this function was not behaving correctly.