TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder:
Tx_Extbase_MVC_Web_Routing_UriBuilder

Public Member Functions

 initializeObject ()
 
 setRequest (\TYPO3\CMS\Extbase\Mvc\Request $request)
 
 getRequest ()
 
 setArguments (array $arguments)
 
 getArguments ()
 
 setSection ($section)
 
 getSection ()
 
 setFormat ($format)
 
 getFormat ()
 
 setCreateAbsoluteUri ($createAbsoluteUri)
 
 getCreateAbsoluteUri ()
 
 getAbsoluteUriScheme ()
 
 setAbsoluteUriScheme ($absoluteUriScheme)
 
 setAddQueryString ($addQueryString)
 
 getAddQueryString ()
 
 setAddQueryStringMethod ($addQueryStringMethod)
 
 getAddQueryStringMethod ()
 
 setArgumentsToBeExcludedFromQueryString (array $argumentsToBeExcludedFromQueryString)
 
 getArgumentsToBeExcludedFromQueryString ()
 
 setArgumentPrefix ($argumentPrefix)
 
 getArgumentPrefix ()
 
 setLinkAccessRestrictedPages ($linkAccessRestrictedPages)
 
 getLinkAccessRestrictedPages ()
 
 setTargetPageUid ($targetPageUid)
 
 getTargetPageUid ()
 
 setTargetPageType ($targetPageType)
 
 getTargetPageType ()
 
 setNoCache ($noCache)
 
 getNoCache ()
 
 setUseCacheHash ($useCacheHash)
 
 getUseCacheHash ()
 
 getLastArguments ()
 
 reset ()
 
 uriFor ($actionName=NULL, $controllerArguments=array(), $controllerName=NULL, $extensionName=NULL, $pluginName=NULL)
 
 build ()
 
 buildBackendUri ()
 
 buildFrontendUri ()
 
 convertTransientObjectToArray (\TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject $object)
 

Protected Member Functions

 removeDefaultControllerAndAction (array $controllerArguments, $extensionName, $pluginName)
 
 buildTypolinkConfiguration ()
 
 convertDomainObjectsToIdentityArrays (array $arguments)
 

Protected Attributes

 $configurationManager
 
 $extensionService
 
 $contentObject
 
 $request
 
 $arguments = array()
 
 $lastArguments = array()
 
 $section = ''
 
 $createAbsoluteUri = FALSE
 
 $absoluteUriScheme = NULL
 
 $addQueryString = FALSE
 
 $addQueryStringMethod = NULL
 
 $argumentsToBeExcludedFromQueryString = array()
 
 $linkAccessRestrictedPages = FALSE
 
 $targetPageUid = NULL
 
 $targetPageType = 0
 
 $noCache = FALSE
 
 $useCacheHash = TRUE
 
 $format = ''
 
 $argumentPrefix = NULL
 
 $environmentService
 

Detailed Description

An URI Builder

Definition at line 23 of file UriBuilder.php.

Member Function Documentation

◆ build()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::build ( )

◆ buildBackendUri()

◆ buildFrontendUri()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::buildFrontendUri ( )

◆ buildTypolinkConfiguration()

◆ convertDomainObjectsToIdentityArrays()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::convertDomainObjectsToIdentityArrays ( array  $arguments)
protected

Recursively iterates through the specified arguments and turns instances of type into an arrays containing the uid of the domain object.

Parameters
array$argumentsThe arguments to be iterated
Exceptions

Definition at line 697 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$arguments, and TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\convertTransientObjectToArray().

Referenced by TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\buildBackendUri(), TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\buildTypolinkConfiguration(), and TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\convertTransientObjectToArray().

◆ convertTransientObjectToArray()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::convertTransientObjectToArray ( \TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject  $object)

Converts a given object recursively into an array.

Parameters
\TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject$object
Returns
array
Todo:
Refactore this into convertDomainObjectsToIdentityArrays()

Definition at line 728 of file UriBuilder.php.

References $result, and TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\convertDomainObjectsToIdentityArrays().

Referenced by TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\convertDomainObjectsToIdentityArrays().

◆ getAbsoluteUriScheme()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getAbsoluteUriScheme ( )
Returns
string

Definition at line 244 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$absoluteUriScheme.

◆ getAddQueryString()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getAddQueryString ( )
Returns
boolean

Definition at line 276 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$addQueryString.

◆ getAddQueryStringMethod()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getAddQueryStringMethod ( )
Returns
string

Definition at line 298 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$addQueryStringMethod.

◆ getArgumentPrefix()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getArgumentPrefix ( )
Returns
string

Definition at line 339 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$argumentPrefix.

◆ getArguments()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getArguments ( )
Returns
array

Definition at line 177 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$arguments.

◆ getArgumentsToBeExcludedFromQueryString()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getArgumentsToBeExcludedFromQueryString ( )

◆ getCreateAbsoluteUri()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getCreateAbsoluteUri ( )
Returns
boolean

Definition at line 237 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$createAbsoluteUri.

◆ getFormat()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getFormat ( )
Returns
string

Definition at line 217 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$format.

◆ getLastArguments()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getLastArguments ( )

Returns the arguments being used for the last URI being built. This is only set after build() / uriFor() has been called.

Returns
array The last arguments

Definition at line 452 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$lastArguments.

◆ getLinkAccessRestrictedPages()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getLinkAccessRestrictedPages ( )
Returns
boolean

Definition at line 359 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$linkAccessRestrictedPages.

◆ getNoCache()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getNoCache ( )
Returns
boolean

Definition at line 421 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$noCache.

◆ getRequest()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getRequest ( )
Returns

Definition at line 155 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$request.

◆ getSection()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getSection ( )
Returns
string

Definition at line 197 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$section.

◆ getTargetPageType()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getTargetPageType ( )
Returns
integer

Definition at line 400 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$targetPageType.

◆ getTargetPageUid()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getTargetPageUid ( )

returns $this->targetPageUid.

Returns
integer

Definition at line 381 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$targetPageUid.

◆ getUseCacheHash()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::getUseCacheHash ( )
Returns
boolean

Definition at line 442 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$useCacheHash.

◆ initializeObject()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::initializeObject ( )

Life-cycle method that is called by the DI container as soon as this object is completely built

Returns
void

Definition at line 137 of file UriBuilder.php.

◆ removeDefaultControllerAndAction()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::removeDefaultControllerAndAction ( array  $controllerArguments,
  $extensionName,
  $pluginName 
)
protected

This removes controller and/or action arguments from given controllerArguments if they are equal to the default controller/action of the target plugin. Note: This is only active in FE mode and if feature "skipDefaultArguments" is enabled

See also
::isFeatureEnabled()
Parameters
array$controllerArgumentsthe current controller arguments to be modified
string$extensionNametarget extension name
string$pluginNametarget plugin name
Returns
array

Definition at line 540 of file UriBuilder.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\uriFor().

◆ reset()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::reset ( )

Resets all UriBuilder options to their default value

Returns
the current UriBuilder to allow method chaining

Definition at line 462 of file UriBuilder.php.

◆ setAbsoluteUriScheme()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setAbsoluteUriScheme (   $absoluteUriScheme)

Sets the scheme that should be used for absolute URIs in FE mode

Parameters
string$absoluteUriSchemethe scheme to be used for absolute URIs
Returns
the current UriBuilder to allow method chaining

Definition at line 254 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$absoluteUriScheme.

◆ setAddQueryString()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setAddQueryString (   $addQueryString)

If set, the current query parameters will be merged with $this->arguments. Defaults to FALSE.

Parameters
boolean$addQueryString
Returns
the current UriBuilder to allow method chaining
See also
TSref/typolink.addQueryString

Definition at line 267 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$addQueryString.

◆ setAddQueryStringMethod()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setAddQueryStringMethod (   $addQueryStringMethod)

Sets the method to get the addQueryString parameters. Defaults undefined which results in using QUERY_STRING.

Parameters
string$addQueryStringMethod
Returns
the current UriBuilder to allow method chaining
See also
TSref/typolink.addQueryString.method

Definition at line 289 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$addQueryStringMethod.

◆ setArgumentPrefix()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setArgumentPrefix (   $argumentPrefix)

Specifies the prefix to be used for all arguments.

Parameters
string$argumentPrefix
Returns
the current UriBuilder to allow method chaining

Definition at line 331 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$argumentPrefix.

◆ setArguments()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setArguments ( array  $arguments)

Additional query parameters. If you want to "prefix" arguments, you can pass in multidimensional arrays: array('prefix1' => array('foo' => 'bar')) gets "&prefix1[foo]=bar"

Parameters
array$arguments
Returns
the current UriBuilder to allow method chaining

Definition at line 168 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$arguments.

◆ setArgumentsToBeExcludedFromQueryString()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setArgumentsToBeExcludedFromQueryString ( array  $argumentsToBeExcludedFromQueryString)

A list of arguments to be excluded from the query parameters Only active if addQueryString is set

Parameters
array$argumentsToBeExcludedFromQueryString
Returns
the current UriBuilder to allow method chaining
See also
TSref/typolink.addQueryString.exclude
setAddQueryString()

Definition at line 312 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$argumentsToBeExcludedFromQueryString.

◆ setCreateAbsoluteUri()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setCreateAbsoluteUri (   $createAbsoluteUri)

If set, the URI is prepended with the current base URI. Defaults to FALSE.

Parameters
boolean$createAbsoluteUri
Returns
the current UriBuilder to allow method chaining

Definition at line 228 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$createAbsoluteUri.

◆ setFormat()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setFormat (   $format)

Specifies the format of the target (e.g. "html" or "xml")

Parameters
string$format
Returns
the current UriBuilder to allow method chaining

Definition at line 208 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$format.

◆ setLinkAccessRestrictedPages()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setLinkAccessRestrictedPages (   $linkAccessRestrictedPages)

If set, URIs for pages without access permissions will be created

Parameters
boolean$linkAccessRestrictedPages
Returns
the current UriBuilder to allow method chaining

Definition at line 350 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$linkAccessRestrictedPages.

◆ setNoCache()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setNoCache (   $noCache)

by default FALSE; if TRUE, &no_cache=1 will be appended to the URI This overrules the useCacheHash setting

Parameters
boolean$noCache
Returns
the current UriBuilder to allow method chaining

Definition at line 412 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$noCache.

◆ setRequest()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setRequest ( \TYPO3\CMS\Extbase\Mvc\Request  $request)

Sets the current request

Parameters
\TYPO3\CMS\Extbase\Mvc\Request$request
Returns
the current UriBuilder to allow method chaining

Definition at line 147 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$request.

◆ setSection()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setSection (   $section)

If specified, adds a given HTML anchor to the URI (#...)

Parameters
string$section
Returns
the current UriBuilder to allow method chaining

Definition at line 188 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$section.

◆ setTargetPageType()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType (   $targetPageType)

Sets the page type of the target URI. Defaults to 0

Parameters
integer$targetPageType
Returns
the current UriBuilder to allow method chaining

Definition at line 392 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$targetPageType.

◆ setTargetPageUid()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageUid (   $targetPageUid)

Uid of the target page

Parameters
integer$targetPageUid
Returns
the current UriBuilder to allow method chaining

Definition at line 370 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$targetPageUid.

◆ setUseCacheHash()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setUseCacheHash (   $useCacheHash)

by default TRUE; if FALSE, no cHash parameter will be appended to the URI If noCache is set, this setting will be ignored.

Parameters
boolean$useCacheHash
Returns
the current UriBuilder to allow method chaining

Definition at line 433 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$useCacheHash.

◆ uriFor()

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::uriFor (   $actionName = NULL,
  $controllerArguments = array(),
  $controllerName = NULL,
  $extensionName = NULL,
  $pluginName = NULL 
)

Creates an URI used for linking to an Extbase action. Works in Frontend and Backend mode of TYPO3.

Parameters
string$actionNameName of the action to be called
array$controllerArgumentsAdditional query parameters. Will be "namespaced" and merged with $this->arguments.
string$controllerNameName of the target controller. If not set, current ControllerName is used.
string$extensionNameName of the target extension, without underscores. If not set, current ExtensionName is used.
string$pluginNameName of the target plugin. If not set, current PluginName is used.
Returns
string the rendered URI
See also
build()

Definition at line 492 of file UriBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\$format, TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\build(), TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule(), and TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder\removeDefaultControllerAndAction().

Member Data Documentation

◆ $absoluteUriScheme

◆ $addQueryString

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$addQueryString = FALSE
protected

◆ $addQueryStringMethod

◆ $argumentPrefix

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$argumentPrefix = NULL
protected

◆ $arguments

◆ $argumentsToBeExcludedFromQueryString

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$argumentsToBeExcludedFromQueryString = array()
protected

◆ $configurationManager

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$configurationManager
protected

Definition at line 29 of file UriBuilder.php.

◆ $contentObject

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$contentObject
protected

Definition at line 42 of file UriBuilder.php.

◆ $createAbsoluteUri

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$createAbsoluteUri = FALSE
protected

◆ $environmentService

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$environmentService
protected

Definition at line 130 of file UriBuilder.php.

◆ $extensionService

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$extensionService
protected

Definition at line 35 of file UriBuilder.php.

◆ $format

◆ $lastArguments

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$lastArguments = array()
protected

◆ $linkAccessRestrictedPages

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$linkAccessRestrictedPages = FALSE
protected

◆ $noCache

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$noCache = FALSE
protected

◆ $request

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$request
protected

◆ $section

◆ $targetPageType

◆ $targetPageUid

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$targetPageUid = NULL
protected

◆ $useCacheHash

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::$useCacheHash = TRUE
protected