Download the PHP package daltcore/ekko without Composer

On this page you can find all versions of the php package daltcore/ekko. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ekko

Ekko

Framework agnostic PHP package for marking navigation items active.

Become a Patron

Features

Installation

From the command line:

By default Ekko is initialized with these sensible defaults:

Laravel

The only dependency for this package is PHP ^8.0, meaning that you can possibly install it on any Laravel version that supports PHP 8 (I think that for now this is only Laravel 8). The service provider is always going to follow the latest Laravel release and try to be as backward compatible as possible.

Laravel 8 will use the auto-discovery function to register the ServiceProvider and the Facade.

If you are not using auto-discovery, you will need to include the service provider and facade in config/app.php:

And add a facade alias to the same file at the bottom:

Overview

To mark a menu item active in Bootstrap, you need to add a active CSS class to the <li> tag:

You could do it manually with Laravel, but you will end up with a sausage:

With Ekko your code could look like this:

or like this:

or this:

Default output value

What if you are not using Bootstrap, but some other framework or a custom design? Instead of returning active CSS class, you can make Ekko return anything you want.

You can alse set the default output value if you don't want to type it everytime:

or in Laravel you can set the default output value in the config config/ekko.php file:

To publish the config for Ekko use this in Laravel:

Using boolean true or false is convenient if you need to display some content depending on which page you are in your layout view:

Global helper functions

Global helper functions are disabled by default. To enable them use Ekko::enableGlobalHelpers(); or $ekko->enableGlobalHelpers().

In Laravel add this code to your app/Providers/AppServiceProvider.php file in register method:

Usage

When used outside a framework, this package has only one main method of interest called isActive. The function accepts an input which can be a string or an array of strings, and an output which can be anything. The default output is active.

It supports strings, arrays, wildcards and query parameters.

Laravel usage

Use the facade Ekko::, resolve(Ekko::class) or app(Ekko::class) to obtain the Laravel bootstraped instance.

Laravel comes with few special methods for named routes and other helper methods. Also, there is a lot of backward compatibility here for v1 of this package.

Methods

Ekko::isActive($input, $output = null) This calls the main Ekko method isActive. Described above.

Ekko::isActiveRoute($input, $output = null) For named routes. Supports arrays and wildcards.

Ekko::areActiveRoutes(array $input, $output = null) For arrays of named routes. Supports wildcards. Backward compatibility. Use isActiveRoute and pass it the same array.

Ekko::isActiveURL($input, $output = null) The same as Ekko::isActive. Backward compatibility. Use Ekko::isActive and pass it the same input.

Ekko::areActiveURLs(array $input, $output = null) The same as Ekko::isActiveURL, but accepts only the array of Urls. Backward compatibility. Use Ekko::isActive and pass it the same array.

Ekko::isActiveMatch($input, $output = null) The same as Ekko::isActive. This method encloses the input with wildcard *. Supports string, array and wildcards as input. Backward compatibility. Use Ekko::isActive and pass it the same input, but with wildcard * at the desired place.

Ekko::areActiveMatches(array $input, $output = null) The same as Ekko::isActiveMatch, but accepts only the array of strings. Backward compatibility. Use Ekko::isActive and pass it the same array.

Development

Credits

Many thanks to:

Sponsors & Backers

I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Backers page.

Contributing

Thank you for considering contributing to Ekko! The contribution guide can be found Here.

Code of Conduct

In order to ensure that the open-source community is welcoming to all, please review and abide by the Code of Conduct.

License

Ekko is open-source software licensed under the MIT license.


All versions of ekko with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daltcore/ekko contains the following files

Loading the files please wait ....