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 RouteMaker

Makes route definitions.

Namespace: ICanBoogie\Routing
Located at RouteMaker.php

Methods summary

public static array
# actions( string $name, string $controller, array $actions, array $options = [] )

Parameters

$name
$controller
$actions
Action templates.
$options

The following options are available:

  • only: Only the routes specified are made.
  • except: The routes specified are excluded.
  • id_name: Name of the identifier property. Defaults to id.
  • id_regex: Regex of the identifier value. Defaults to \d+.
  • as: Specifies the as option of the routes created.

Returns

array
public static array
# resource( string $name, string $controller, array $options = [] )

Makes route definitions for a resource.

Makes route definitions for a resource.

Parameters

$name
$controller
$options

The following options are available:

  • only: Only the routes specified are made.
  • except: The routes specified are excluded.
  • id_name: Name of the identifier property. Defaults to id.
  • id_regex: Regex of the identifier value. Defaults to \d+.
  • as: Specifies the as option of the routes created.
  • actions: Additional actions templates.

Returns

array
protected static array
# normalize_options( array $options )

Normalizes options.

Normalizes options.

Parameters

$options

Returns

array
protected static array
# get_resource_actions( )

Returns default resource actions.

Returns default resource actions.

Returns

array
protected static array
# filter_actions( array $actions, array $options = [] )

Filters actions according to only/except options.

Filters actions according to only/except options.

Parameters

$actions
$options

Returns

array
protected static array
# resolve_patterns( string $name, array $actions, array $options )

Replaces pattern placeholders.

Replaces pattern placeholders.

Parameters

$name
$actions
$options

Returns

array

Constants summary

string ACTION_INDEX
# 'index'
string ACTION_NEW
# 'new'
string ACTION_CREATE
# 'create'
string ACTION_SHOW
# 'show'
string ACTION_EDIT
# 'edit'
string ACTION_UPDATE
# 'update'
string ACTION_DELETE
# 'delete'
string OPTION_ID_NAME
# 'id_name'
string OPTION_ID_REGEX
# 'id_regex'
string OPTION_ONLY
# 'only'
string OPTION_EXCEPT
# 'except'
string OPTION_AS
# 'as'
string OPTION_ACTIONS
# 'actions'
string SEPARATOR
# ':'
string CONTROLLER_ACTION_SEPARATOR
# '#'
ICanBoogie/Routing master API documentation generated by ApiGen