Download the PHP package alleyinteractive/wp-path-dispatch without Composer

On this page you can find all versions of the php package alleyinteractive/wp-path-dispatch. 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 wp-path-dispatch

WP Path Dispatch

Coding Standards Testing Suite

Simply and easily add a URL which fires an action, triggers a callback, and/or loads a template.

Installation

You can install the package via composer:

Usage

At any point before init,

This will cause http://domain.com/some-path/ to call some_function().

IMPORTANT! You must flush your rewrites after adding a path.

You can add multiple paths at once with add_paths():

The dispatch happens on parse_query, so you can then modify the query via pre_get_posts or do whatever you have to do. You can even just load a static file and exit if you simply need to render static content.

When the path is loaded, the action dispatch_path_{$path} is fired. You can hook onto this instead of or in addition to passing a callback to add_path(s). The callback is optional.

Lastly, you can set custom rewrites if your paths are more complex. In these cases, the 'path' argument essentially becomes a slug. See add_rewrite_rule() for details about 'rule', 'redirect' (rewrite), and 'position'.

Full breakdown of all the path options

Examples

Simplest possible usages: fires the action 'dispatch_path_my-path' at http://domain.com/my-path/

This can even be simplified further as:

Call the function 'my_function' at http://domain.com/my-path/

Load the template file 'dispatch-custom-page.php' at http://domain.com/my-path/

Add a custom rewrite rule. Fires the action 'dispatch_path_my-path' at e.g. http://domain.com/my-path/foo/ and sets the query var 'my_path' to 'foo'. This assumes you already registered that query var.

Same as above, but registers the query var automatically, and loads the template 'dispatch-my-page.php'.

Same as above, but with multiple query vars, and with a callback instead of a template.

Changelog

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

Credits

This project is actively maintained by Alley Interactive. Like what you see? Come work with us.

License

The GNU General Public License (GPL) license. Please see License File for more information.


All versions of wp-path-dispatch 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 alleyinteractive/wp-path-dispatch contains the following files

Loading the files please wait ....