Download the PHP package ooobii/quick-router without Composer

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

Quick Router for PHP

Build Status Test Status Composer

A quick & easy way to start developing an API / web service application using PHP & Apache.

Heads Up! Documentation is not complete. There may be some gaps in usage instructions.


Requirements

Installation

This package can be installed with composer:

In order to use this package, an .htaccess file / rewrite rules are required to defined so that all requests are processed by the index.php file. You can create / update one in the site's directory by executing the following PHP script:

This method will create a .htaccess file in your project's root folder. If one already exists, the rewrite rules that this package requires will automatically be appended to the end of it. The rules this method generates can also be defined in Apache's virtual host configuration if you'd prefer to have them there.

Usage

Create a Router

You can define a new router by instantiating a new Router class:

You can pass 2 arguments to the Router class constructor:

You can also define multiple routers with different root URLs:

You can pass these routers by reference to an external script file to setup routes for each router. Any routers that are defined must be included in the index.php file.

Define Routes in a Router

Error Handle Routes

Once you instantiate a router, you can add handlers for errors that are encountered by specific HTTP error codes:

The methods above add return handlers for specific HTTP error codes. The first argument is the HTTP error code, and the second argument is a callback function that will be executed when the route is matched. The callback function will receive the exception object as its only argument.

Note: In this example, it is assumed that JSON output enforcement is enabled. Be sure your route handlers returns a proper echo type or echo's out a proper result based on the content being delivered.

Define Standard Routes


All versions of quick-router with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.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 ooobii/quick-router contains the following files

Loading the files please wait ....