ICanBoogie
  • Documentation
  • API Reference
  • Routing v2.3.0
Namespaces
  • ICanBoogie
    • Routing
      • ActionController
      • Controller
      • Dispatcher
      • Route
Classes
  • ActionController
  • Controller
  • Dispatcher
  • FormattedRoute
  • Helpers
  • Pattern
  • Route
  • Routes
Interfaces
  • Exception
  • ToSlug
Exceptions
  • ActionNotDefined
  • ControllerNotDefined
  • PatternNotDefined
  • PatternRequiresValues
  • RouteNotDefined

Class Routes

A route collection.

ICanBoogie\Routing\Routes implements IteratorAggregate, ArrayAccess
Namespace: ICanBoogie\Routing
Located at Routes.php

Methods summary

public __construct( array $routes = [] )
public __call( $method, array $arguments )
protected add( array $definition )
public getIterator( void )

Implementation of

IteratorAggregate::getIterator()
public offsetExists( $offset )

Implementation of

ArrayAccess::offsetExists()
public offsetGet( $id )

Implementation of

ArrayAccess::offsetGet()
public offsetSet( string $id, array $route )

Define a route.

Define a route.

Parameters

$id
The identifier of the route.
$route
The route definition.

Implementation of

ArrayAccess::offsetSet()
public offsetUnset( string $offset )

Removes a route.

Removes a route.

Parameters

$offset
The identifier of the route.

Implementation of

ArrayAccess::offsetUnset()
public find( string $uri, array|null & $captured = null, string $method = Request::METHOD_ANY, string $namespace = null ) : ICanBoogie\Routing\Route|false|null

Search for a route matching the specified pathname and method.

Search for a route matching the specified pathname and method.

Parameters

$uri

The URI to match. If the URI includes a query string it is removed before searching for a matching route.

$captured

The parameters captured from the URI. If the URI included a query string, its parsed params are stored under the __query__ key.

$method
One of HTTP\Request::METHOD_* methods.
$namespace
Namespace restriction.

Returns

ICanBoogie\Routing\Route|false|null

Magic methods summary

public any( void ) : ICanBoogie\Routing\Routes

any(string $pattern, $controller, array $options=[]) Add a route for any HTTP method.

any(string $pattern, $controller, array $options=[]) Add a route for any HTTP method.

Returns

ICanBoogie\Routing\Routes
public connect( void ) : ICanBoogie\Routing\Routes

connect(string $pattern, $controller, array $options=[]) Add a route for the HTTP method CONNECT.

connect(string $pattern, $controller, array $options=[]) Add a route for the HTTP method CONNECT.

Returns

ICanBoogie\Routing\Routes
public delete( void ) : ICanBoogie\Routing\Routes

delete(string $pattern, $controller, array $options=[]) Add a route for the HTTP method DELETE.

delete(string $pattern, $controller, array $options=[]) Add a route for the HTTP method DELETE.

Returns

ICanBoogie\Routing\Routes
public get( void ) : ICanBoogie\Routing\Routes

get(string $pattern, $controller, array $options=[]) Add a route for the HTTP method GET.

get(string $pattern, $controller, array $options=[]) Add a route for the HTTP method GET.

Returns

ICanBoogie\Routing\Routes
public head( void ) : ICanBoogie\Routing\Routes

head(string $pattern, $controller, array $options=[]) Add a route for the HTTP method HEAD.

head(string $pattern, $controller, array $options=[]) Add a route for the HTTP method HEAD.

Returns

ICanBoogie\Routing\Routes
public options( void ) : ICanBoogie\Routing\Routes

options(string $pattern, $controller, array $options=[]) Add a route for the HTTP method OPTIONS.

options(string $pattern, $controller, array $options=[]) Add a route for the HTTP method OPTIONS.

Returns

ICanBoogie\Routing\Routes
public post( void ) : ICanBoogie\Routing\Routes

post(string $pattern, $controller, array $options=[]) Add a route for the HTTP method POST.

post(string $pattern, $controller, array $options=[]) Add a route for the HTTP method POST.

Returns

ICanBoogie\Routing\Routes
public put( void ) : ICanBoogie\Routing\Routes

put(string $pattern, $controller, array $options=[]) Add a route for the HTTP method PUT.

put(string $pattern, $controller, array $options=[]) Add a route for the HTTP method PUT.

Returns

ICanBoogie\Routing\Routes
public patch( void ) : ICanBoogie\Routing\Routes

patch(string $pattern, $controller, array $options=[]) Add a route for the HTTP method PATCH

patch(string $pattern, $controller, array $options=[]) Add a route for the HTTP method PATCH

Returns

ICanBoogie\Routing\Routes
public trace( void ) : ICanBoogie\Routing\Routes

trace(string $pattern, $controller, array $options=[]) Add a route for the HTTP method TRACE.

trace(string $pattern, $controller, array $options=[]) Add a route for the HTTP method TRACE.

Returns

ICanBoogie\Routing\Routes

Constants summary

DEFAULT_ROUTE_CLASS : string
'ICanBoogie\Routing\Route'

Properties summary

protected $routes : array

Route definitions.

Route definitions.

[]
protected $instances : ICanBoogie\Routing\Route[]

Route instances.

Route instances.

[]
Routing v2.3.0 – Check on GitHub – API documentation generated by ApiGen