ControllersFactory
in package
Uses
EnumResolverTrait
This is the ControllersFactory class, a factory of Controllers.
This class facilitates the creation of the Controllers.
Tags
Table of Contents
getController() | This method returns the Controller that corresponds to the given Route. | : Controller|null |
---|---|---|
getInternalController() | This method returns an array containing the internal Controller and the Route of the request. | : array<string|int, mixed>|null |
getPath() | This method returns the controller path of the route type given by parameter. | : string |
Methods
getController()
This method returns the Controller that corresponds to the given Route.
public
static getController(Route $route, array<string|int, mixed> $locations) : Controller|null
It searches the Controller in the locations given by parameter, following the given order in the array (it stops searching when it finds the first occurrence).
Parameters
- $route : Route
- $locations : array<string|int, mixed>
Return values
Controller|null —getInternalController()
This method returns an array containing the internal Controller and the Route of the request.
public
static getInternalController(array<string|int, mixed> $locations) : array<string|int, mixed>|null
It searches the Controller in the locations given by parameter, following the given order in the array (it stops searching when it finds the first occurrence).
Parameters
- $locations : array<string|int, mixed>
Return values
array<string|int, mixed>|null —Containing Controller and Route
getPath()
This method returns the controller path of the route type given by parameter.
public
static getPath(string $type) : string
Parameters
- $type : string