Default router for Hubleto project.
\Hubleto\Framework\Router
Constants
| Constant |
Visibility |
Type |
Value |
HTTP_GET |
public |
|
'HTTP_GET' |
Properties
☍ routing
public $routing
☍ route
protected string $route
☍ routesHttpGet
protected array $routesHttpGet
☍ routeVars
protected array $routeVars
Methods
ƒ __construct
public __construct(): mixed
ƒ init
public init(): void
ƒ extractParamsFromRequest
public extractParamsFromRequest(): array
ƒ extractRouteFromRequest
public extractRouteFromRequest(): string
ƒ isAjax
public isAjax(): bool
ƒ get
public get(array $routes): mixed
Parameters
| Parameter |
Type |
Description |
$routes |
array |
|
ƒ getRoutes
public getRoutes(string $method): array
Parameters
| Parameter |
Type |
Description |
$method |
string |
|
ƒ getRoute
public getRoute(): string
ƒ setRoute
public setRoute(string $route): void
Parameters
| Parameter |
Type |
Description |
$route |
string |
|
ƒ parseRoute
array<string, array<string, string>>
public parseRoute(string $method, string $route): array
Parameters
| Parameter |
Type |
Description |
$method |
string |
|
$route |
string |
|
ƒ setRouteVars
public setRouteVars(array $routeVars): void
Parameters
| Parameter |
Type |
Description |
$routeVars |
array |
|
ƒ getRouteVars
public getRouteVars(): array
ƒ getRouteVar
public getRouteVar(string|int $varIndex): string
Parameters
| Parameter |
Type |
Description |
$varIndex |
string|int |
|
ƒ routeVarAsString
public routeVarAsString(string|int $varIndex): string
Parameters
| Parameter |
Type |
Description |
$varIndex |
string|int |
|
ƒ routeVarAsInteger
public routeVarAsInteger(string|int $varIndex): int
Parameters
| Parameter |
Type |
Description |
$varIndex |
string|int |
|
ƒ routeVarAsFloat
public routeVarAsFloat(string|int $varIndex): float
Parameters
| Parameter |
Type |
Description |
$varIndex |
string|int |
|
ƒ routeVarAsBool
public routeVarAsBool(string|int $varIndex): bool
Parameters
| Parameter |
Type |
Description |
$varIndex |
string|int |
|
ƒ getUploadedFile
public getUploadedFile(string $paramName, ?array $defaultValue = null): null|array
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
?array |
|
ƒ redirectTo
public redirectTo(string $url, int $code = 302): void
Parameters
| Parameter |
Type |
Description |
$url |
string |
|
$code |
int |
|
ƒ getUrlParams
public getUrlParams(): array
ƒ isUrlParam
public isUrlParam(string $paramName): bool
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
ƒ urlParamNotEmpty
public urlParamNotEmpty(string $paramName): bool
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
ƒ setUrlParam
public setUrlParam(string $paramName, string $newValue): void
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$newValue |
string |
|
ƒ removeUrlParam
public removeUrlParam(string $paramName): void
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
ƒ urlParamAsString
public urlParamAsString(string $paramName, string $defaultValue = ''): string
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
string |
|
ƒ urlParamAsInteger
public urlParamAsInteger(string $paramName, int $defaultValue): int
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
int |
|
ƒ urlParamAsFloat
public urlParamAsFloat(string $paramName, float $defaultValue): float
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
float |
|
ƒ urlParamAsBool
public urlParamAsBool(string $paramName, bool $defaultValue = false): bool
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
bool |
|
ƒ urlParamAsArray
public urlParamAsArray(string $paramName, array $defaultValue = []): array<string,string>
Parameters
| Parameter |
Type |
Description |
$paramName |
string |
|
$defaultValue |
array |
|
Inherited methods
ƒ __construct
public __construct(): mixed
ƒ 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 |
|
ƒ env
Shortcut for the env service.
public env(): \Hubleto\Framework\Env
ƒ authProvider
Shortcut for the authentication service.
public authProvider(): \Hubleto\Framework\Interfaces\AuthInterface
ƒ db
Shortcut for the database service.
public db(): \Hubleto\Framework\Db
ƒ appManager
Shortcut for the app manager service.
public appManager(): \Hubleto\Framework\Interfaces\AppManagerInterface
ƒ router
Shortcut for the router service.
public router(): \Hubleto\Framework\Router
ƒ hookManager
Shortcut for the hook manager service.
public hookManager(): \Hubleto\Framework\HookManager
ƒ sessionManager
Shortcut for the session manager service.
public sessionManager(): \Hubleto\Framework\SessionManager
ƒ permissionsManager
Shortcut for the permissions manager service.
public permissionsManager(): \Hubleto\Framework\PermissionsManager
ƒ cronManager
Shortcut for the cron manager service.
public cronManager(): \Hubleto\Framework\CronManager
ƒ emailProvider
Shortcut for the email provider service.
public emailProvider(): \Hubleto\Framework\EmailProvider
ƒ 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 |
|