Download the PHP package lumax/routing-component without Composer

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

Luma | Routing Component

Version 1.6.2 PHP Coverage 77.49% License GPL--3.0--or--later

The Routing Component is a lightweight and flexible PHP package for handling routing in your web application. It provides a simple way to define routes and execute controller actions based on incoming HTTP requests. This component is designed to be easily integrated into your PHP projects and works seamlessly with PSR-11 compliant dependency injection containers.

Installation

You can install this package using Composer:

Usage

Basic Usage

Create a Router Instance

Create an instance of the Router class, passing a dependency injection container that implements the Psr\Container\ContainerInterface:

Load Routes:

Load your application's routes from a YAML configuration file:

Example YAML configuration (routes.yaml):

Alternatively, you can load your routes from an array if you'd prefer:

Handle Requests:

In your application's entry point (e.g., index.php), call the handleRequest method to handle incoming HTTP requests:

The handleRequest method expects an instance of Psr\Http\Message\RequestInterface. This Routing Component requires my HTTP Component, therefore Request and Response classes are already provided.

The router will match the request URI to the defined routes and execute the corresponding controller action.

Controller Actions

Controller actions are defined as arrays containing the controller class name and the method name:

Dependencies

The Router class is designed to work seamlessly with dependency injection containers. You can inject dependencies into your controller actions through constructor injection. When a controller is instantiated, the router will automatically resolve and inject its dependencies from the container. Requires a PSR-11 compliant ContainerInterface instance.

Error Handling

The router handles 404 Not Found errors for unhandled routes. If no matching route is found, it will respond with a 404 status code.

License

This package is open-source software licensed under the GNU General Public License, version 3.0 (GPL-3.0).


All versions of routing-component with dependencies

PHP Build Version
Package Version
Requires psr/container Version ^2.0
symfony/yaml Version ^6.3
psr/http-message Version ^2.0
lumax/security-component Version ^1.3
lumax/http-component Version ^2.2
lumax/framework-component Version ^1.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 lumax/routing-component contains the following files

Loading the files please wait ....