Download the PHP package theorythree/navprompt without Composer

On this page you can find all versions of the php package theorythree/navprompt. 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 navprompt

NavPrompt

Latest Version on Packagist Build Status Total Downloads

Description

A simple solution for a simple problem. This package marks HTML elements with a CSS is-active class based on the current URI. Although this package was originally conceived to be used on navigation, it can be used anywhere you need to mark elements with an active class name.

How to Install

Step 1: Via Composer

Step 2: Define the service provider and alias in your Laravel project

This package takes advantage of the new auto-discovery feature found in Laravel 5.5+. If you're using that version of Laravel, then you may skip this step.

Add NavPrompt Service Provider to config/app.php.

Define the NavPrompt Alias to config/app.php.

Step 3. Publish the plugin config file (Optional)

Publish the configuration file to override the package defaults. The package is setup by default to work with Bulma - which uses an active class name of is-active, however if your project is using Bootstrap, you'll want to override the default active class name to active. To do this, publish the config file used by this plugin and set the override for the active_class value to active.

$ php artisan vendor:publish --tag=navprompt This command will generate a config file in config/navprompt.php.

Usage

This package uses the alias Nav:: to access the plugin class in your project template files. You can use any of the following methods to check your routes against:

  1. routeIsNamed() // checks URI against Laravel named route
  2. routeIs() // checks URI against full URI provided
  3. routeContains() // checks URI to see if it contains provided slug

routeIsNamed()

String routeIsNamed( String $route, String $active=NULL )

Description

Accepts a string of the desired Laravel named route for NavPrompt to check against and returns an empty string (no match) or a string containing the name of the active class (match).

Parameters

$route

String: The Laravel route name to test against

$active

String | NULL (OPTIONAL): The name of the CSS class that should be returned if a URI match occurs

Example


routeIs()

String routeIs( String $route, String $active=NULL )

Description

This method is designed to be used in cases when testing the full URI path is needed. For example, if you have several, similar links that you need to test.

Accepts a string of the full URI for NavPrompt to check against and returns an empty string (no match) or a string containing the name of the active class (match). This method is designed to be used in cases where

Parameters

$route

String: The full URI route to test against

$active

String | NULL (OPTIONAL): The name of the CSS class that should be returned if a URI match occurs

Example


routeContains()

String routeContains( String|Array $slugs, Int|Array $positions, String $active=NULL )

Description

This method is designed to be used in cases when you need to check for the existence of a specific URI slug within the full URI path.

Accepts a string (or array of strings) of the URI slug(s), and an optional position integer (or array of integers), for NavPrompt to check against and returns an empty string (no match) or a string containing the name of the active class (match). This method is designed to be used in cases where

Parameters

$slugs

String|Array: The URI slug(s) to test against

$positions

Int | Array (OPTIONAL): The position(s) of the URI slug in relation to the full URI.

$active

String | NULL (OPTIONAL): The name of the CSS class that should be returned if a URI match occurs

Example

Basic Example:

Basic Position Example:

Advanced Position Example:


Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

All contributors welcome. If you would like to contribute to this package please feel to submit a pull request, submit an issue, or request a feature.

See our CODE_OF_CONDUCT for more details.

Credits

Contact

Want to get in touch to discuss this package, or another one you'd like us to build? Feel free to reach out to the maintainer of this package by emailing me at @dmerfeld. I'd really like to hear from you. Honest.

License

The MIT License (MIT). Please see License File for more information.


All versions of navprompt with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.1
php Version ~5.6|~7.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 theorythree/navprompt contains the following files

Loading the files please wait ....