PHP Класс PHPFusion\Rewrite\Router

You can use this API to Add custom rules for handling requests
Наследование: extends RewriteDriver
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$routing boolean True = SEF URL to FilePath False = File Path to SEF URL

Открытые методы

Метод Описание
__construct ( )
getFilePath ( ) Index Include File
rewritePage ( ) Call all the functions to process rewrite detection and further actions.
setGetParameters ( mixed $get_parameters )
setPathtofile ( mixed $pathtofile )
setquerystring ( ) Set the new QUERY_STRING This function will set the values of QUERY_STRING to new value which is calculated in buildParams().
setservervars ( ) Set the PHP_SELF and SCRIPT_NAME to the suitable filepath.

Защищенные методы

Метод Описание
makeSearchRegex ( string $pattern, string $type ) Builds the Regex pattern for a specific Type string

Приватные методы

Метод Описание
buildParams ( ) Builds the $_GET parameters This function will build the GET parameters and also the Query String.
checkAlias ( ) Checks if there is any matching Alias or not
checkAliasPatterns ( ) Checks if there is any matching Alias Pattern or not
checkPattern ( ) Builds the Regular Expressions Patterns
explodeURL ( string $url, string $param_delimiter = "&" ) Explodes a URL into Filename and Get Parameters
getAliasURL ( string $url, string $php_url, string $type ) Get Alias URL for Router This function will return an Array of 2 elements for a specific Alias: 1. The Permalink URL of Alias 2. PHP URL of the Alias
importPatterns ( ) Import the Available Patterns from Database
setVariables ( ) Call the Functions to Set GET Parameters and Query String This function will call the functions to set Server GET parameters and the QUERY_STRING.

Описание методов

__construct() публичный Метод

public __construct ( )

getFilePath() публичный Метод

Returns the filename of the php file which will be included. If this file is blank, index.php will redirect to 404 error page
public getFilePath ( )

makeSearchRegex() защищенный Метод

This function will build the Regex pattern for a specific string, which is passed to the function.
protected makeSearchRegex ( string $pattern, string $type )
$pattern string The String
$type string Type or Handler name

rewritePage() публичный Метод

This will call all the other functions after all the included files have been included and all the patterns have been made.
public rewritePage ( )

setGetParameters() публичный Метод

public setGetParameters ( mixed $get_parameters )
$get_parameters mixed

setPathtofile() публичный Метод

public setPathtofile ( mixed $pathtofile )
$pathtofile mixed

setquerystring() публичный Метод

Set the new QUERY_STRING This function will set the values of QUERY_STRING to new value which is calculated in buildParams().
public setquerystring ( )

setservervars() публичный Метод

This function will set the values of PHP_SELF and SCRIPT_NAME to the suitable file name. The filename will be searched in the $pattern_replace array. The php filename is found before '?' in the pattern.
public setservervars ( )

Описание свойств

$routing публичное свойство

True = SEF URL to FilePath False = File Path to SEF URL
public bool $routing
Результат boolean