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 Route

A route.

ICanBoogie\Routing\Route uses ICanBoogie\Accessor\AccessorTrait (not available)
Namespace: ICanBoogie\Routing
Located at Route.php

Methods summary

public static from( array $definition ) : ICanBoogie\Routing\Route

Creates a new ICanBoogie\Routing\Route instance from a route definition.

Creates a new ICanBoogie\Routing\Route instance from a route definition.

Parameters

$definition

Returns

ICanBoogie\Routing\Route
protected get_pattern( void )
protected get_controller( void )
protected get_action( void )
protected get_id( void )
protected get_location( void )
protected get_via( void )
protected get_formatting_value( void ) : mixed

Returns the formatting value.

Returns the formatting value.

Returns

mixed
protected get_has_formatting_value( void ) : boolean

Whether the route has a formatting value.

Whether the route has a formatting value.

Returns

boolean
true if the route has a formatting value, false otherwise.
protected get_url( void ) : string

Returns relative URL.

Returns relative URL.

Returns

string
protected get_absolute_url( void ) : string

Returns absolute URL.

Returns absolute URL.

Returns

string
public __construct( string $pattern, array $properties )

Initializes the $pattern property and the properties provided.

Initializes the $pattern property and the properties provided.

Parameters

$pattern
$properties
public __clone( void )
public __toString( void ) : string

Formats a route into a relative URL using its formatting value.

Formats a route into a relative URL using its formatting value.

Returns

string
protected assert_properties_are_valid( array $properties, array $invalid )

Asserts that properties are valid.

Asserts that properties are valid.

Parameters

$properties
$invalid

Throws

InvalidArgumentException
if a property is not valid.
public format( object|array|null $values = null ) : ICanBoogie\Routing\FormattedRoute

Formats the route with the specified values.

Formats the route with the specified values.

Note: The formatting of the route is deferred to its ICanBoogie\Routing\Pattern instance.

Parameters

$values

Returns

ICanBoogie\Routing\FormattedRoute
public assign( mixed $formatting_value ) : ICanBoogie\Routing\Route

Assigns a formatting value to a route.

Assigns a formatting value to a route.

Parameters

$formatting_value
A formatting value.

Returns

ICanBoogie\Routing\Route
A new route bound to a formatting value.

Properties summary

protected static $invalid_construct_properties : array
[ 'formatting_value', 'url', 'absolute_url' ]

Magic properties

public read-only $pattern : ICanBoogie\Routing\Pattern

The pattern of the route.

public read-only $controller : string

The class name of the controller.

public read-only $action : string|null

Controller action.

public read-only $id : string

Route identifier.

public read-only $location : string|null

Redirection destination.

public read-only $via : string|array|null

The supported HTTP methods.

public read-only $url : string

The contextualized URL of the route.

public read-only $absolute_url : string

The contextualized absolute URL of the route.

public read-only $formatting_value : mixed

The value used to format the route.

public read-only $has_formatting_value : boolean

true if the route has a formatting value, false otherwise.

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