Router
in package
Router management with list of ressources authorized (avoid file inclusion or code inclusion)
Table of Contents
Properties
- $accesHandler : AccessHandler
- $pagesFolder : string
- $scriptFolder : string
- $stylesFolder : string
- $whiteListAccesPages : array<string|int, mixed>
- $whiteListeOfCSS : array<string|int, mixed>
- $whiteListOfJS : array<string|int, mixed>
- $whiteListOfPages : array<string|int, mixed>
- $whiteListOfTitle : array<string|int, mixed>
Methods
- __construct() : mixed
- Construct a router Create a list of pages, styles and scripts files to accept only them on GET method
- createLink() : string
- getListsComponents() : void
- Return the whole properties constructed
- getWhiteListOfAccessPages() : mixed
- getWhiteListOfCSS() : mixed
- getWhiteListOfJS() : mixed
- getWhiteListOfPages() : mixed
- getWhiteListOfTitles() : mixed
- linkTo() : array<string|int, mixed|string>
- Summary of linkTo
Properties
$accesHandler
private
AccessHandler
$accesHandler
$pagesFolder
private
string
$pagesFolder
$scriptFolder
private
string
$scriptFolder
$stylesFolder
private
string
$stylesFolder
$whiteListAccesPages
private
array<string|int, mixed>
$whiteListAccesPages
= []
$whiteListeOfCSS
private
array<string|int, mixed>
$whiteListeOfCSS
= []
$whiteListOfJS
private
array<string|int, mixed>
$whiteListOfJS
= []
$whiteListOfPages
private
array<string|int, mixed>
$whiteListOfPages
= []
$whiteListOfTitle
private
array<string|int, mixed>
$whiteListOfTitle
= []
Methods
__construct()
Construct a router Create a list of pages, styles and scripts files to accept only them on GET method
public
__construct(array<string|int, mixed> $aWhiteListOfPages, array<string|int, mixed> $aWhiteListOfTitle, array<string|int, mixed> $aWhiteListOfCSS, array<string|int, mixed> $whiteListOfJS, array<string|int, mixed> $aWhiteListOfAccess, string $aStyleFolder, string $aPagesFolder, string $aScriptFolder) : mixed
Parameters
- $aWhiteListOfPages : array<string|int, mixed>
- $aWhiteListOfTitle : array<string|int, mixed>
- $aWhiteListOfCSS : array<string|int, mixed>
- $whiteListOfJS : array<string|int, mixed>
- $aWhiteListOfAccess : array<string|int, mixed>
- $aStyleFolder : string
- $aPagesFolder : string
- $aScriptFolder : string
createLink()
public
createLink(mixed $ressourceType, mixed $elementIndex[, mixed $nomLien = null ]) : string
Parameters
- $ressourceType : mixed
-
the type of file to include
- $elementIndex : mixed
-
the place where the item is store on the list
- $nomLien : mixed = null
-
if the type of file is page, then give a name to the link
Return values
string —output the link or error
getListsComponents()
Return the whole properties constructed
public
getListsComponents() : void
Return values
void —A list at HTML format of each properties
getWhiteListOfAccessPages()
public
getWhiteListOfAccessPages() : mixed
getWhiteListOfCSS()
public
getWhiteListOfCSS() : mixed
getWhiteListOfJS()
public
getWhiteListOfJS() : mixed
getWhiteListOfPages()
public
getWhiteListOfPages() : mixed
getWhiteListOfTitles()
public
getWhiteListOfTitles() : mixed
linkTo()
Summary of linkTo
public
linkTo(string $link, Session $session) : array<string|int, mixed|string>
Parameters
- $link : string
-
the link from the GET method
- $session : Session
-
Session object to verify role access
Return values
array<string|int, mixed|string> —return on a array each file inclusion