Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Site
The site
request attribute hold information about the current
site in the object \TYPO3\
.
It is available in frontend and backend context.
Example:
$site = $request->getAttribute('site');
$siteConfiguration = $site->getConfiguration();
Note
In backend context the attribute can hold a
\TYPO3\
object when the module does not
provide a page tree or no page in the page tree is selected.
API
- class Site
-
- Fully qualified name
-
\TYPO3\
CMS\ Core\ Site\ Entity\ Site
Entity representing a single site with available languages
- getIdentifier ( )
-
Gets the identifier of this site, mainly used when maintaining / configuring sites.
- returntype
-
string
- getLanguageById ( int $languageId)
-
Returns a language of this site, given by the sys_language_uid
- param int $languageId
-
the languageId
- returntype
-
TYPO3\CMS\Core\Site\Entity\SiteLanguage
- getAvailableLanguages ( TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication $user, bool $includeAllLanguagesFlag = false, int $pageId = NULL)
-
- param TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication $user
-
the user
- param bool $includeAllLanguagesFlag
-
the includeAllLanguagesFlag, default: false
- param int $pageId
-
the pageId, default: NULL
- returntype
-
array
- getErrorHandler ( int $statusCode)
-
Returns a ready-to-use error handler, to be used within the ErrorController
- param int $statusCode
-
the statusCode
- returntype
-
TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface