SiteContextServiceInterface
SiteContextServiceInterface.php
:
14
Interface
Constants¶
CONTEXT_AWARE_ROUTE_ATTRIBUTE ¶
SiteContextServiceInterface.php
:
20
Route default that makes an admin page outside the content structure context-aware, so the site context can be changed from it.
|
|
|
Methods¶
getCurrentContext()
¶
SiteContextServiceInterface.php
:
26
Returns the site access given to {@see runInContext()} while its callback runs, otherwise the one the current user has selected in the back office.
|
|
|
Return values
SiteAccess|null
isFullscreenModeEnabled()
¶
SiteContextServiceInterface.php
:
48
|
|
|
Return values
bool
resolveContextLanguage()
¶
SiteContextServiceInterface.php
:
50
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $siteAccess | SiteAccess | - | - |
| $content | Content | - | - |
Return values
string
runInContext()
¶
SiteContextServiceInterface.php
:
39
Runs the callback with the given site access as the current context (null, an empty or unknown name: no site access), regardless of the user's selection, and restores the previous context afterwards.
|
|
|
A selection changed with setCurrentContext() inside the callback takes effect after it.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $siteAccessName | string|null | - | - |
| $callback | callable(): T | - | - |
Return values
T
setCurrentContext()
¶
SiteContextServiceInterface.php
:
44
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $siteAccess | SiteAccess|null | - | - |
setFullscreenMode()
¶
SiteContextServiceInterface.php
:
46
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $state | bool | - | - |