Jelix 1.7.18

UrlActionMapper
in package

an url engine to parse,analyse and create significant url it needs an urls.xml file in the app/system directory (see documentation).

Tags
author

Laurent Jouanneau

copyright

2005-2016 Laurent Jouanneau

Table of Contents

ESCAPE_LANG  = 4
ESCAPE_LOCALE  = 8
ESCAPE_NON_ASCII  = 2
ESCAPE_SLASH  = 1
ESCAPE_URLENCODE  = 0
$config  : mixed
$dataCreateUrl  : array<string|int, mixed>
data to create significant url.
$dataParseUrl  : array<string|int, mixed>
data to parse and anaylise significant url, and to determine action, module etc.
$entryPointTypeHavingActionInBody  : mixed
$xmlfileSelector  : mixed
__clone()  : mixed
__construct()  : mixed
create()  : jUrl
Create a jurl object with the given action data.
getConfig()  : MapperConfig
parse()  : jUrlAction
Parse some url components.
parseFromRequest()  : jUrlAction
Parse a url from the request.
_parse()  : jUrlAction
buildForDedicatedModule()  : mixed
for the patterns "module~@request".
buildForWholeController()  : mixed
for the patterns "module~ctrl:*@request".
buildWithHandler()  : mixed
buildWithSpecificPathinfo()  : mixed
getUrlBuilderInfo()  : array<string|int, mixed>
search informations allowing to build the url corresponding to the given module/action.
parseBasicPathinfo()  : mixed
parseGetParams()  : jUrlAction
extract parameters for the action from the path info.
parseWithHandler()  : jUrlAction
call an handler to parse the url.
simplifyDefaultAction()  : mixed

Constants

Properties

$dataCreateUrl

data to create significant url.

protected array<string|int, mixed> $dataCreateUrl

$dataParseUrl

data to parse and anaylise significant url, and to determine action, module etc.

protected array<string|int, mixed> $dataParseUrl

.

$entryPointTypeHavingActionInBody

protected mixed $entryPointTypeHavingActionInBody = array('xmlrpc', 'jsonrpc', 'soap')

Methods

create()

Create a jurl object with the given action data.

public create(jUrlAction $urlact) : jUrl
Parameters
$urlact : jUrlAction
Tags
author

Laurent Jouanneau

copyright

2005 CopixTeam, 2005-2006 Laurent Jouanneau very few lines of code are copyrighted by CopixTeam, written by Laurent Jouanneau and released under GNU Lesser General Public Licence, in an experimental version of Copix Framework v2.3dev20050901, http://www.copix.org.

Return values
jUrl

the url correspondant to the action

parse()

Parse some url components.

public parse(string $scriptNamePath, string $pathinfo, array<string|int, mixed> $params) : jUrlAction
Parameters
$scriptNamePath : string

/path/index.php

$pathinfo : string

the path info part of the url (part between script name and query)

$params : array<string|int, mixed>

url parameters (query part e.g. $_REQUEST)

Return values
jUrlAction

parseFromRequest()

Parse a url from the request.

public parseFromRequest(jRequest $request, array<string|int, mixed> $params) : jUrlAction
Parameters
$request : jRequest
$params : array<string|int, mixed>

url parameters

Tags
since
1.1
Return values
jUrlAction

_parse()

protected _parse(string $scriptNamePath, string $pathinfo, array<string|int, mixed> $params, bool $isHttps) : jUrlAction
Parameters
$scriptNamePath : string

/path/index.php

$pathinfo : string

the path info part of the url (part between script name and query)

$params : array<string|int, mixed>

url parameters (query part e.g. $_REQUEST)

$isHttps : bool

says if the given url is asked with https or not

Return values
jUrlAction

buildForDedicatedModule()

for the patterns "module~@request".

protected buildForDedicatedModule(jUrlAction $urlact, jUrl $url, array<string|int, mixed> $urlinfo) : mixed
Parameters
$urlact : jUrlAction
$url : jUrl
$urlinfo : array<string|int, mixed>

array(3, 'entrypoint', boolean https true/false, boolean defaultmodule true/false, 'pathinfobase'),

Return values
mixed

buildForWholeController()

for the patterns "module~ctrl:*@request".

protected buildForWholeController(jUrlAction $urlact, jUrl $url, array<string|int, mixed> $urlinfo) : mixed
Parameters
$urlact : jUrlAction
$url : jUrl
$urlinfo : array<string|int, mixed>

array(5, 'entrypoint', boolean https true/false, 'pathinfobase'),

Return values
mixed

buildWithHandler()

protected buildWithHandler(jUrlAction $urlact, jUrl $url, array<string|int, mixed> $urlinfo) : mixed
Parameters
$urlact : jUrlAction
$url : jUrl
$urlinfo : array<string|int, mixed>

array(0, 'entrypoint', boolean https true/false, 'handler selector', 'basepathinfo')

Return values
mixed

buildWithSpecificPathinfo()

protected buildWithSpecificPathinfo(jUrlAction $urlact, jUrl $url, array<string|int, mixed> $urlinfo) : mixed
Parameters
$urlact : jUrlAction
$url : jUrl
$urlinfo : array<string|int, mixed>

array(1,'entrypoint', https true/false, array('year','month',), // list of dynamic values included in the url array(true, false..), // list of integers which indicates for each // dynamic value: 0: urlencode, 1:urlencode except '/', 2:escape "/news/%1/%2/", // the url true/false, // false : this is a secondary action array('bla'=>'whatIWant' ) // list of static values )

Return values
mixed

getUrlBuilderInfo()

search informations allowing to build the url corresponding to the given module/action.

protected getUrlBuilderInfo(jUrlAction $urlact, jUrl $url) : array<string|int, mixed>
Parameters
$urlact : jUrlAction
$url : jUrl
Return values
array<string|int, mixed>

the informations. It may be:

  • array(0,'entrypoint', https true/false, 'handler selector', 'basepathinfo')
  • array(1,'entrypoint', https true/false, array('year','month',), // list of dynamic values included in the url array(true, false..), // list of integers which indicates for each // dynamic value: 0: urlencode, 1:urlencode except '/', 2:escape "/news/%1/%2/", // the url true/false, // false : this is a secondary action array('bla'=>'whatIWant' ) // list of static values )
  • array(2,'entrypoint', https true/false), // for the patterns "@request"
  • array(3,'entrypoint', https true/false, $defaultmodule true/false, 'pathinfobase'), // for the patterns "module~@request"
  • array(4, array(1,...), array(1,...)...)
  • array(5, 'entrypoint', https true/false,)

parseBasicPathinfo()

protected parseBasicPathinfo(mixed $infoparsing, jUrl $url) : mixed
Parameters
$infoparsing : mixed
$url : jUrl
Return values
mixed

parseGetParams()

extract parameters for the action from the path info.

protected parseGetParams(mixed $infoparsing, jUrl $url, mixed $matches) : jUrlAction
Parameters
$infoparsing : mixed
$url : jUrl
$matches : mixed
Tags
params

array $infoparsing we have this array array( 0=>'module', 1=>'action', 2=>'regexp_pathinfo', 3=>array('year','month'), // list of dynamic value included in the url, // alphabetical ascendant order 4=>array(0, 1..), // list of integer which indicates for each // dynamic value: 0: urlencode, 1:urlencode except '/', 2:escape, 4: lang, 8: locale

5=>array('bla'=>'whatIWant' ), // list of static values 6=>false or array('secondaries','actions') 7=>true/false true if https is needed

params

array $matches result of the match with the regexp corresponding to the url

Return values
jUrlAction

or null if the handler does not accept the url

parseWithHandler()

call an handler to parse the url.

protected parseWithHandler(mixed $infoparsing, jUrl $url) : jUrlAction
Parameters
$infoparsing : mixed
$url : jUrl
Return values
jUrlAction

or null if the handler does not accept the url

simplifyDefaultAction()

protected simplifyDefaultAction(mixed $pathInfo, mixed $action) : mixed
Parameters
$pathInfo : mixed
$action : mixed
Return values
mixed

Search results