PHP code example of darling / roady-routes

1. Go to this page and download the library: Download darling/roady-routes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

darling / roady-routes example snippets




namespace \Darling\RoadyRoutes\interfaces\identifiers;

/**
 * A NamedPosition assoiciates a Name with a Position.
 */
interface NamedPosition
{
    public function positionName(): PositionName;
    public function position(): Position;
}




namespace \Darling\RoadyRoutes\interfaces\collections;

/**
 * A NamedPositionCollection defines a collection of NamedPositions.
 */
interface NamedPositionCollection
{
    /**
     * Return a numerically indexed array of NamedPositions.
     *
     * @return array<int, NamedPosition>
     *
     */
    public function collection(): array;

}




namespace \Darling\RoadyRoutes\interfaces\routes;

use \Darling\RoadyRoutes\interfaces\paths\RelativePath;
use \Darling\RoadyRoutes\interfaces\collections\NamedPositionCollection;
use \Darling\PHPTextTypes\interfaces\collections\NameCollection;

/**
 * A Route defines the relationship between a collection of Names,
 * a collection of NamedPositions, and a RelativePath.
 *
 */
interface Route
{

    public function namedPositions(): NamedPositionCollection;
    public function names(): NameCollection;
    public function relativePath(): RelativePath;

}




namespace \Darling\RoadyRoutes\interfaces\collections;

/**
 * A RouteCollection defines a collection of Routes.
 *
 */
interface RouteCollection
{
    /**
     * Return a numerically indexed array of Routes.
     *
     * @return array<int, Route>
     *
     */
    public function collection(): array;

}