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 RouteMaker

Makes route definitions.

Namespace: ICanBoogie\Routing
Located at RouteMaker.php

Methods summary

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

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 resource( string $name, string $controller, array $options = [] ) : array

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 normalize_options( array $options ) : array

Normalizes options.

Normalizes options.

Parameters

$options

Returns

array
protected static get_resource_actions( void ) : array

Returns default resource actions.

Returns default resource actions.

Returns

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

Filters actions according to only/except options.

Filters actions according to only/except options.

Parameters

$actions
$options

Returns

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

Replaces pattern placeholders.

Replaces pattern placeholders.

Parameters

$name
$actions
$options

Returns

array

Constants summary

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