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

Active::methods need to be static? #19

Closed spacesuitdiver closed 9 years ago

spacesuitdiver commented 9 years ago

I'm trying to call Active::route('routename') in my view and get:

Non-static method HieuLe\Active\Active::route() should not be called statically, assuming $this from incompatible context ...

I tried to just rewrite the functions with static methods but that led to the router needing to be instantiated so I wasn't sure what to do from there.

letrunghieu commented 9 years ago

Hi @LeBlaaanc

To use methods statically, you have to add the alias to the right Facade class as in the read me file. From your log, I see that the route method is called in the wrong class.