Default router for Hubleto project.
\Hubleto\Framework\Services\Router
| Parent class | \Hubleto\Framework\Core |
| Implements | \Hubleto\Framework\Interfaces\RouterInterface |
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
HTTP_GET |
public | 'HTTP_GET' |
Properties
Methods
ƒ __construct
public __construct(): mixed
ƒ init
[Description for init]
public init(): void
ƒ extractParamsFromRequest
[Description for extractParamsFromRequest]
public extractParamsFromRequest(): array
ƒ extractRouteFromRequest
[Description for extractRouteFromRequest]
public extractRouteFromRequest(): string
ƒ isAjax
[Description for isAjax]
public isAjax(): bool
ƒ get
[Description for get]
public get(array $routes): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$routes |
array |
ƒ crud
public crud(string $urlSlug, string $controllerClass): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$urlSlug |
string | |
$controllerClass |
string |
ƒ getRoutes
[Description for getRoutes]
public getRoutes(string $method): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$method |
string |
ƒ getRoute
[Description for getRoute]
public getRoute(): string
ƒ setRoute
[Description for setRoute]
public setRoute(string $route): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$route |
string |
ƒ parseRoute
[Description for parseRoute]
public parseRoute(string $method, string $route): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$method |
string | |
$route |
string |
ƒ setRouteVars
[Description for setRouteVars]
public setRouteVars(array $routeVars): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$routeVars |
array |
ƒ getRouteVars
[Description for getRouteVars]
public getRouteVars(): array
ƒ getRouteVar
[Description for getRouteVar]
public getRouteVar(string|int $varIndex): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$varIndex |
string|int |
ƒ routeVarAsString
[Description for routeVarAsString]
public routeVarAsString(string|int $varIndex): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$varIndex |
string|int |
ƒ routeVarAsInteger
[Description for routeVarAsInteger]
public routeVarAsInteger(string|int $varIndex): int
Parameters
| Parameter | Type | Description |
|---|---|---|
$varIndex |
string|int |
ƒ routeVarAsFloat
[Description for routeVarAsFloat]
public routeVarAsFloat(string|int $varIndex): float
Parameters
| Parameter | Type | Description |
|---|---|---|
$varIndex |
string|int |
ƒ routeVarAsBool
[Description for routeVarAsBool]
public routeVarAsBool(string|int $varIndex): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$varIndex |
string|int |
ƒ getUploadedFile
[Description for getUploadedFile]
public getUploadedFile(string $paramName, array|null $defaultValue = null): null|array
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
array|null |
ƒ redirectTo
public redirectTo(string $route, int $code = 302): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$route |
string | |
$code |
int |
ƒ getUrlParams
[Description for getUrlParams]
public getUrlParams(): array
ƒ isUrlParam
[Description for isUrlParam]
public isUrlParam(string $paramName): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string |
ƒ urlParamNotEmpty
[Description for urlParamNotEmpty]
public urlParamNotEmpty(string $paramName): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string |
ƒ setUrlParam
[Description for setUrlParam]
public setUrlParam(string $paramName, string $newValue): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$newValue |
string |
ƒ removeUrlParam
[Description for removeUrlParam]
public removeUrlParam(string $paramName): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string |
ƒ urlParamAsString
[Description for urlParamAsString]
public urlParamAsString(string $paramName, string $defaultValue = ''): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
string |
ƒ urlParamAsInteger
[Description for urlParamAsInteger]
public urlParamAsInteger(string $paramName, int $defaultValue): int
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
int |
ƒ urlParamAsFloat
[Description for urlParamAsFloat]
public urlParamAsFloat(string $paramName, float $defaultValue): float
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
float |
ƒ urlParamAsBool
[Description for urlParamAsBool]
public urlParamAsBool(string $paramName, bool $defaultValue = false): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
bool |
ƒ urlParamAsArray
[Description for urlParamAsArray]
public urlParamAsArray(string $paramName, array $defaultValue = []): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$paramName |
string | |
$defaultValue |
array |
Inherited methods
ƒ __construct
public __construct(): mixed
ƒ setDebugLevel
[Description for setDebugLevel]
public setDebugLevel(int $level): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$level |
int |
ƒ getDebugLevel
[Description for getDebugLevel]
public getDebugLevel(): int
ƒ getServiceStatic
Shortcut for the dependency injection.
public static getServiceStatic(string $service): mixed
- This method is static.
Parameters
| Parameter | Type | Description |
|---|---|---|
$service |
string |
ƒ getService
[Description for getService]
public getService(string $service): mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$service |
string |
ƒ loader
Shortcut for the loader service.
public loader(): \Hubleto\Framework\Loader
ƒ env
Shortcut for the env service.
public env(): \Hubleto\Framework\Interfaces\EnvInterface
ƒ authProvider
Shortcut for the authentication service.
public authProvider(): \Hubleto\Framework\Interfaces\AuthProviderInterface
ƒ db
Shortcut for the database service.
public db(): \Hubleto\Framework\Interfaces\DbInterface
ƒ appManager
Shortcut for the app manager service.
public appManager(): \Hubleto\Framework\Interfaces\AppManagerInterface
ƒ router
Shortcut for the router service.
public router(): \Hubleto\Framework\Interfaces\Router
ƒ eventManager
Shortcut for the event manager service.
public eventManager(): \Hubleto\Framework\Interfaces\EventManagerInterface
ƒ sessionManager
Shortcut for the session manager service.
public sessionManager(): \Hubleto\Framework\Interfaces\SessionManagerInterface
ƒ permissionsManager
Shortcut for the permissions manager service.
public permissionsManager(): \Hubleto\Framework\Interfaces\PermissionsManagerInterface
ƒ cronManager
Shortcut for the cron manager service.
public cronManager(): \Hubleto\Framework\Interfaces\CronManagerInterface
ƒ config
Shortcut for the config service.
public config(): \Hubleto\Framework\Interfaces\ConfigManagerInterface
ƒ terminal
Shortcut for the terminal service.
public terminal(): \Hubleto\Framework\Interfaces\TerminalInterface
ƒ logger
Shortcut for the logger service.
public logger(): \Hubleto\Framework\Interfaces\LoggerInterface
ƒ locale
Shortcut for the locale service.
public locale(): \Hubleto\Framework\Interfaces\LocaleInterface
ƒ renderer
Shortcut for the renderer service.
public renderer(): \Hubleto\Framework\Interfaces\RendererInterface
ƒ translator
Shortcut for the translator service.
public translator(): \Hubleto\Framework\Interfaces\TranslatorInterface
ƒ getModel
[Description for getModel]
public getModel(string $model): \Hubleto\Framework\Interfaces\ModelInterface
Parameters
| Parameter | Type | Description |
|---|---|---|
$model |
string |
ƒ getController
[Description for getController]
public getController(string $controller): \Hubleto\Framework\Controller
Parameters
| Parameter | Type | Description |
|---|---|---|
$controller |
string |
ƒ translate
public translate(string $string, array<string,string> $vars = [], string $contextInner = ''): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$string |
string | |
$vars |
array<string,string> | |
$contextInner |
string |
