EsiWidgetController
extends EsiWidgetController
in package
JsonAdapter Controller to handle EsiWidgets Usage: - Create a subclass that implements parseWidget() - Register it as a Controller in your ComponentController
Tags
Table of Contents
Properties
- $cx : Cx
- Main class instance
- $esiParamPage : Page
- Holds
Methods
- __call() : mixed
- Route methods like getName(), getType(), getDirectory(), etc.
- __construct() : mixed
- Creates new controller
- getAccessableMethods() : array<string|int, mixed>
- Returns an array of method names accessable from a JSON request
- getDefaultPermissions() : Permission
- Returns default permission as object
- getMessagesAsString() : string
- Returns all messages as string
- getName() : string
- Returns the internal name used as identifier for this adapter
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- getWidget() : array<string|int, mixed>
- Returns the content of a widget
- parseWidget() : mixed
- Parses a widget
- internalParseWidget() : array<string|int, mixed>
- Parses a widget
- objectifyParams() : array<string|int, mixed>
- This makes object of the given params (if possible) Known params are page, lang, user, theme, channel, country, currency and ref
Properties
$cx
Main class instance
protected
Cx
$cx
= null
$esiParamPage
Holds
protected
static Page
$esiParamPage
= null
Methods
__call()
Route methods like getName(), getType(), getDirectory(), etc.
public
__call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
- $methodName : string
-
Name of method to call
- $arguments : array<string|int, mixed>
-
List of arguments for the method to call
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Return value of the method to call
__construct()
Creates new controller
public
__construct(SystemComponentController $systemComponentController, Cx $cx) : mixed
Parameters
- $systemComponentController : SystemComponentController
-
Main controller for this system component
- $cx : Cx
-
Main class instance
getAccessableMethods()
Returns an array of method names accessable from a JSON request
public
getAccessableMethods() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —List of method names
getDefaultPermissions()
Returns default permission as object
public
getDefaultPermissions() : Permission
Tags
Return values
Permission —Required permission
getMessagesAsString()
Returns all messages as string
public
getMessagesAsString() : string
Tags
Return values
string —HTML encoded error messages
getName()
Returns the internal name used as identifier for this adapter
public
getName() : string
Tags
Return values
string —Name of this adapter
getSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
getWidget()
Returns the content of a widget
public
getWidget(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
JsonAdapter parameters
Return values
array<string|int, mixed> —Content in an associative array
parseWidget()
Parses a widget
public
parseWidget(string $name, Sigma $template, Response $response, array<string|int, mixed> $params) : mixed
Parameters
internalParseWidget()
Parses a widget
protected
internalParseWidget(Widget $widget, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $widget : Widget
-
The Widget
- $params : array<string|int, mixed>
-
Params passed by ESI (/API) request
Return values
array<string|int, mixed> —Content in an associative array
objectifyParams()
This makes object of the given params (if possible) Known params are page, lang, user, theme, channel, country, currency and ref
protected
objectifyParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Associative array of params
Return values
array<string|int, mixed> —Associative array of params