Download the PHP package darling/roady-routing-utilities without Composer
On this page you can find all versions of the php package darling/roady-routing-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download darling/roady-routing-utilities
More information about darling/roady-routing-utilities
Files in darling/roady-routing-utilities
Package roady-routing-utilities
Short Description Routing utilities for the Roady php framework.
License MIT
Informations about the package roady-routing-utilities
RoadyRoutingUtilities
The RoadyRoutingUtilities library provides the classes responsible
for handling routing for the Roady
php
framework.
Though it is designed for use with the Roady
php
framework, this library can be used on it's own.
Installation
Classes
Darling\RoadyRoutingUtilities\classes\requests\Request
A Request represents a request to a server.
A Request has a Name, and a Url.
A Request's Name will either be based on the value of the request
query parameter that is assigned to the Request's Url, the value
of $_POST['request']
, or the value of $_GET['request']
.
If the Url is not assigned a query parameter named request
, and
nither $_POST['request']
or $_GET['request']
is set, then
the Request's Name will be homepage
.
Note: The Url's request query parameter will always be preferred if
it is set, then $_POST['request']
, then $_GET['request']
.
Examples:
To define a Request that represents the current request to a server instantiate a new Request without any arguments:
To define a Request that represents a specific request to a server an
opitional url string
such as http://example.com:8080?query#fragment
may be passed to the new Request's __construct
method.
For example:
Darling\RoadyRoutingUtilities\classes\responses\Response
A Response represents the relationship between a Request and collection of Routes that should be served in response to that Request.
Examples:
To define a Response for a specific Request to a server:
Darling\RoadyRoutingUtilities\classes\routers\Router
A Router can accept a Request and return an appropriate Response for that Request.
Examples:
As a final example, the following is a snippet from Roady's
index.php
demonstrating how a Request, Response, and
Router are used in practice:
All versions of roady-routing-utilities with dependencies
darling/php-darling-dev-tools Version ^1.0
darling/php-file-system-paths Version ^1.0
darling/php-text-types Version ^1.1
darling/php-unit-test-utilities Version ^1.0
darling/php-web-paths Version ^1.0
darling/roady-module-utilities Version ^1.0
darling/roady-routes Version ^1.0