ICanBoogie
  • Documentation
  • API Reference
  • Routing master
Namespaces
  • ICanBoogie
    • Routing
      • Controller
      • Route
      • RouteDispatcher
Classes
  • Controller
  • FormattedRoute
  • Helpers
  • Pattern
  • Route
  • RouteCollection
  • RouteDefinition
  • RouteDispatcher
  • RouteMaker
Interfaces
  • Exception
  • ToSlug
Exceptions
  • ActionNotDefined
  • ControllerNotDefined
  • PatternNotDefined
  • PatternRequiresValues
  • RouteNotDefined

Class RouteDefinition

The class defines options that can be used to define a route as well as means to normalize and validate this definition.

Namespace: ICanBoogie\Routing
Located at RouteDefinition.php

Methods summary

public static normalize( array & $definition )

Normalizes a route definition.

Normalizes a route definition.

Parameters

$definition
public static ensure_has_id( array & $definition ) : string

Ensures that a route definition has an identifier and generates one if required.

Ensures that a route definition has an identifier and generates one if required.

Parameters

$definition

Returns

string
The route identifier.
public static assert_is_valid( array $definition )

Asserts that a route definition is valid.

Asserts that a route definition is valid.

Parameters

$definition

Throws

ICanBoogie\Routing\PatternNotDefined
when the pattern is not defined
ICanBoogie\Routing\ControllerNotDefined
when both controller and location are not defined.

Constants summary

PATTERN : string

Pattern of the route.

Pattern of the route.

'pattern'
CONTROLLER : string

A controller class name (with an optional action) or a callable.

A controller class name (with an optional action) or a callable.

'controller'
ACTION : string

The controller action.

The controller action.

'action'
ID : string

An identifier.

An identifier.

'id'
LOCATION : string

A redirection target.

A redirection target.

'location'
VIA : string

Request method(s) accepted by the route.

Request method(s) accepted by the route.

'via'
CONSTRUCTOR : string

Route constructor, a class name for now.

Route constructor, a class name for now.

'class'
Routing master – Check on GitHub – API documentation generated by ApiGen