laravelista / ekko Goto Github PK
View Code? Open in Web Editor NEWFramework agnostic PHP package for marking navigation items active.
License: MIT License
Framework agnostic PHP package for marking navigation items active.
License: MIT License
After adding to composer.json
file and doing composer update
, I get this when the command of php artisan clear-compiled
gets called.
[2015-05-22 15:14:01] local.ERROR: exception 'BadMethodCallException' with message 'Call to undefined method [package]' in /Users/iolson/Projects/laravel-project/vendor/compiled.php:4476
Stack trace:
#0 /Users/iolson/Projects/laravel-project/vendor/laravelista/ekko/src/Laravelista/Ekko/EkkoServiceProvider.php(21): Illuminate\Support\ServiceProvider->__call('package', Array)
#1 /Users/iolson/Projects/laravel-project/vendor/laravelista/ekko/src/Laravelista/Ekko/EkkoServiceProvider.php(21): Laravelista\Ekko\EkkoServiceProvider->package('laravelista/ekk...')
#2 [internal function]: Laravelista\Ekko\EkkoServiceProvider->boot()
#3 /Users/iolson/Projects/laravel-project/vendor/compiled.php(925): call_user_func_array(Array, Array)
#4 /Users/iolson/Projects/laravel-project/vendor/compiled.php(1526): Illuminate\Container\Container->call(Array)
#5 /Users/iolson/Projects/laravel-project/vendor/compiled.php(1518): Illuminate\Foundation\Application->bootProvider(Object(Laravelista\Ekko\EkkoServiceProvider))
#6 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Laravelista\Ekko\EkkoServiceProvider), 26)
#7 /Users/iolson/Projects/laravel-project/vendor/compiled.php(1519): array_walk(Array, Object(Closure))
#8 /Users/iolson/Projects/laravel-project/vendor/compiled.php(1837): Illuminate\Foundation\Application->boot()
#9 /Users/iolson/Projects/laravel-project/vendor/compiled.php(1314): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#10 /Users/iolson/Projects/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(195): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 /Users/iolson/Projects/laravel-project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(92): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 /Users/iolson/Projects/laravel-project/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}
Call to undefined method Laravelista\Ekko\Facades\Ekko::isActiveRoute()
Hi. There is a bug on file: helpers.php line 53:
Replace:
return app(Ekko::class)->areActiveRoutes($string, $output);
with
return app(Ekko::class)->areActiveRoutes($routeNames, $output);
Hi, I'm running Laravel 5.3 and this package doesn't seem to be working correctly.
It never shows active on a route.
Edit:
Nvm, need to use named routes.
How can I accomplish the scenario below?
<li class="{{ isActiveURL('/posts?type=featured') }}">
...
</li>
Would be useful to be able to do isActiveURL('/events/*')
. The isActiveMatch
method is too limiting, since you might not want to match e.g. users/1/events/123
.
I could prepare a PR for this, but before I do so I'd like to know if it's likely that it would be accepted?
if (!function_exists('are_active_match')) {
/**
* Detects if the given string array is found in the current URL.
*
* @param array $matches
* @param string $output
*
* @return string
*/
function are_active_match($matches, $output = "active")
{
foreach($matches as $match){
if(isActiveMatch($match)){
return $output;
}
}
return null;
}
}
Resource model routes have a bunch of predefined route names that follow a pattern. For example, to administer a user, you may define the user resource route like this:
Route::resource('users', 'UserController');
That generates the routes users.index
, users.show
, users.create
etc.
Instead of having to list all these routes in an array, it would be great to be able to use a wildcard. a simple globbling approach would be work well, without the overhead of REs:
class="{{ Ekko::isActiveRoute('users.*') }}"
Maybe this is already supported in some way?
Wildcard feature does not work on nested routes.
route = cars.makes.show
Using either of the following fails.
areActiveRoutes(['cars.*', ... ])
areActiveRoutes(['cars.makes.*', ... ])
Ekko works great but now im using ARCANEDEV/Localization
this works if i dont use Localization
<li class="{{ Ekko::isActiveURL('dashboard') }}">
now my urls are changed based on a language /en/dashboard /nl/dashboard etc
and <li class="{{ Ekko::isActiveURL('dashboard') }}">
is not working anymore
hi if i have my URL
admin/client/1
the 1 is a dynamic param.
how i can check that url. ?
thk a lot
If you have route frontend.users.show.stats
using Ekko isActiveRoute('frontend.users.*)
does not return active
, but it returns active
for route frontend.users.show
.
Need to locate the problem and fix it.
Is your product supports laravel v5.4? Please provide compatibility table. It is very lacking thing. Thank zou.
Laravel provides route lookup by URL, name or action, but only the two first are currently supported by Ekko. Would be useful if Ekko could also support action based route matching:
isActiveAction('controllerName@action')
isActiveAction('controllerName@*')
Rewrite readme.md
so that it better describes the package and what it does.
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.