AppRouter
in package
Description of AppRouter
Tags
Table of Contents
- ROUTE_LIST_FILE = FS_FOLDER . DIRECTORY_SEPARATOR . 'MyFiles' . DIRECTORY_SEPARATOR . 'routes.json'
- Path to list of routes stored on file.
- $routes : array<string|int, mixed>
- List of routes.
- __construct() : mixed
- AppRouter constructor.
- clear() : mixed
- Clear the App routes.
- getApp() : App
- Return the specific App controller for any kind of petition.
- getFile() : bool
- Return true if can output a file, false otherwise.
- isFileSafe() : bool
- setRoute() : mixed
- Adds this route to the ap routes.
- deploy() : mixed
- Deploy all dynamic files.
- download() : mixed
- getMime() : string
- Return the mime type from given file.
- getUri() : bool|string
- Return the uri from the request.
- loadFromFile() : array<string|int, mixed>
- Returns an array with the list of plugins in the plugin.list file.
- newAppController() : App
- save() : void
- Save the routes in a file.
Constants
ROUTE_LIST_FILE
Path to list of routes stored on file.
public
mixed
ROUTE_LIST_FILE
= FS_FOLDER . DIRECTORY_SEPARATOR . 'MyFiles' . DIRECTORY_SEPARATOR . 'routes.json'
Properties
$routes
List of routes.
private
array<string|int, mixed>
$routes
Methods
__construct()
AppRouter constructor.
public
__construct() : mixed
Return values
mixed —clear()
Clear the App routes.
public
clear() : mixed
Return values
mixed —getApp()
Return the specific App controller for any kind of petition.
public
getApp() : App
Return values
App —getFile()
Return true if can output a file, false otherwise.
public
getFile() : bool
Return values
bool —isFileSafe()
public
static isFileSafe(string $filePath) : bool
Parameters
- $filePath : string
Return values
bool —setRoute()
Adds this route to the ap routes.
public
setRoute(string $newRoute, string $controllerName[, string $optionalId = '' ][, bool $checkOptionalId = true ]) : mixed
Parameters
- $newRoute : string
- $controllerName : string
- $optionalId : string = ''
- $checkOptionalId : bool = true
Return values
mixed —deploy()
Deploy all dynamic files.
private
deploy() : mixed
Return values
mixed —download()
private
download(string $filePath) : mixed
Parameters
- $filePath : string
Return values
mixed —getMime()
Return the mime type from given file.
private
getMime(string $filePath) : string
Parameters
- $filePath : string
Return values
string —getUri()
Return the uri from the request.
private
getUri() : bool|string
Return values
bool|string —loadFromFile()
Returns an array with the list of plugins in the plugin.list file.
private
loadFromFile() : array<string|int, mixed>
Return values
array<string|int, mixed> —newAppController()
private
newAppController(string $uri[, string $pageName = '' ]) : App
Parameters
- $uri : string
- $pageName : string = ''
Return values
App —save()
Save the routes in a file.
private
save() : void