IInitialStateService¶
-
interface
OCP\
IInitialStateService
¶ Implemented by: OC\InitialStateService
Source: lib/public/IInitialStateService.php#37
Methods¶
-
public
OCP\IInitialStateService::
provideInitialState
($appName, $key, $data)¶ - Allows an app to provide its initial state to the template system.Use this if you know your initial state sill be used for example ifyou are in the render function of you controller.
Source: Parameters: - $appName (string)
- $key (string)
- $data (bool | int | float | string | array |
\JsonSerializable
)
Since: 16.0.0
Deprecated: 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider
See: \OCP\AppFramework\Services\IInitialState::provideInitialState()
-
public
OCP\IInitialStateService::
provideLazyInitialState
($appName, $key, $closure)¶ - Allows an app to provide its initial state via a lazy method.This will call the closure when the template is being generated.Use this if your app is injected into pages. Since then the render methodis not called explicitly. But we do not want to load the state on webdavrequests for example.
Source: Parameters: - $appName (string)
- $key (string)
- $closure (
Closure
) returns a primitive or an object that implements JsonSerializable
Since: 16.0.0
Deprecated: 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider
See: \OCP\AppFramework\Services\IInitialState::provideLazyInitialState()