arcesilas / active-state Goto Github PK
View Code? Open in Web Editor NEWLaravel link active state helper based on URL, route or query string
License: MIT License
Laravel link active state helper based on URL, route or query string
License: MIT License
Hello, how are you? I am trying to use the ifQueryHas method.
Laravel v5.5.48
active-state v2.1.0
I tried to follow this README example:
Check query string contains argument foo with value bar:
<a class="nav-link {{Active::ifQueryHas('videos.category', ['slug' => $category->slug])}}" href="{{ route('videos.category', $category->slug) }}">
Then returns me the following error:
my tag: <a class="nav-link {{Active::ifQueryHas('site.noticias.listar', ['pagina' => $noticias->currentPage()])}}" href="#">test</a>
I'm trying to use the package with a pagination that involves categories and search. I don't know if I'm doing it the right way. If so, could you inform me? thanks
I tried to install on version 6.6, but to no avail.
When I use the function if true would not it be to return the 'active_state' config?
Currently, Active::checkRouteIs()
accepts an array of routes, but the format of the array is a little complex, in my opinion, for an actual use in a view:
[
'some.route' => ['slug' => 'something'],
'route.test' => ['slug' => 'title']
]
@marcelogarbin do you think this usage is relevant?
Personnally, I think it's not really usable in a view and am considering to remove this functionnality. What do you think?
Hi,
I just noticed that
https://test.localhost/notifications
and
https://test.localhost/notifications?all=1
return for
{{ active_url_is('notifications') }}
both the active
string.
May it be that query params are not part of the exact url check? I would like to differentiate between the path without and with query parameters. Is there something for that use case?
In the lib at line
Line 57 in 633d1ba
is()
method makes use of a string comparison with http://php.net/manual/en/function.rawurldecode.php at https://github.com/laravel/framework/blob/2906b572aa83ff46b8ad57093dd0e859c0ff783f/src/Illuminate/Http/Request.php#L148
And if I see that right, the url should be the whole thing.
Hello,
I started using your package...
the "Active::checkRoute()" method is working?
I did this test: {{ Active::checkRoute('user.index') }}
But returned:
ErrorException (E_ERROR) Call to undefined method Arcesilas\ActiveState\Active::checkRoute()
What can it be?
Hello friend,
I'm using the package, however I realized that the "ifRouteIs" method is not working when used array.
Even though the route exists, validation is passed as if it does not exist.
I was even trying to make code changes, but I do not know how to cross-test in PHP.
I am using version 1.2 with Laravel 5.4
I have installed according to the instructions and added
'providers' => [
...
Arcesilas\ActiveState\ActiveStateServiceProvider::class,
]
to config/app.php
but I am receiving the error Class 'Arcesilas\ActiveState\ActiveStateServiceProvider' not found
Hi,
I'm currently with Laravel 5.4, with "pyaesone17/active-state" v1.2.
Good update work.
Thank's
Doubt over class name configuration pass.
Would it be possible to pass the class name when calling the method? Example:
<li class="{{ Active::ifRouteIn('site.index', 'current') }}"><a href="{{ url('/') }}" title="Início"><div>Início</div></a></li>
Hello, how are you?
I'm facing a problem, in my localhost the command {{ Active::ifRouteIs('site.cardapio', 'pizzas']) }}
is working normally, but when I uploaded the project to a shared server it does not seem to work to function.
I use 2 methods in the menu, the "ifRouteIn" which is working normally and the "ifRouteIs" that is not, however the 2 work normal in localhost.
Do you have any suggestions whatsoever?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.