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

Class Route

A route.

ICanBoogie\Object
┗ ICanBoogie\Routing\Route
Namespace: ICanBoogie\Routing
Located at Route.php

Methods summary

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_routes( void )
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( ICanBoogie\Routing\Routes $routes, string $pattern, array $properties )

Initializes the $pattern property and the properties provided.

Initializes the $pattern property and the properties provided.

Parameters

$routes
$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', 'routes', 'url', 'absolute_url' ]

Magic properties

public read-only $routes : ICanBoogie\Routing\Routes

The route collection this route belongs to.

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 v2.4.0 – Check on GitHub – API documentation generated by ApiGen