ICanBoogie/Routing master
  • Namespace
  • Class

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

Functions

  • absolutize_url
  • contextualize
  • decontextualize

Class Route

A route.

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

Methods summary

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

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( )
protected
# get_controller( )
protected
# get_action( )
protected
# get_id( )
protected
# get_location( )
protected
# get_via( )
protected mixed
# get_formatting_value( )

Returns the formatting value.

Returns the formatting value.

Returns

mixed
protected boolean
# get_has_formatting_value( )

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 string
# get_url( )

Returns relative URL.

Returns relative URL.

Returns

string
protected string
# get_absolute_url( )

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( )
public string
# __toString( )

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 ICanBoogie\Routing\FormattedRoute
# format( object|array|null $values = null )

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 ICanBoogie\Routing\Route
# assign( mixed $formatting_value )

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 array $invalid_construct_properties
# [ 'formatting_value', 'url', 'absolute_url' ]

Magic properties

public read-only ICanBoogie\Routing\Pattern $pattern

The pattern of the route.

public read-only string $controller

The class name of the controller.

public read-only string|null $action

Controller action.

public read-only string $id

Route identifier.

public read-only string|null $location

Redirection destination.

public read-only string|array|null $via

The supported HTTP methods.

public read-only string $url

The contextualized URL of the route.

public read-only string $absolute_url

The contextualized absolute URL of the route.

public read-only mixed $formatting_value

The value used to format the route.

public read-only boolean $has_formatting_value

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

ICanBoogie/Routing master API documentation generated by ApiGen