BaseWidget
abstract class BaseWidget implements WidgetInterface (View source)
BaseWidget can be used as easy starter pack or as a base for your own widgets.
Traits
Properties
protected string | $name | ||
protected string | $target | ||
protected string | $zone | ||
protected ExtensionInterface | $extension | ||
protected int | $priority | ||
protected string | $template | ||
protected string | $templateFolder | ||
protected ?string | $slug | ||
protected int | $cacheDuration |
Methods
No description
No description
No description
No description
No description
No description
No description
Method to 'invoke' the widget. Simple wrapper around the 'run' method, which can be overridden in a custom Widget or trait
Actual method that 'runs' the widget and returns the output. For reasons
of extensibility: Do not call directly, but call $widget()
to invoke.
No description
No description
No description
No description
No description
No description
No description
Details
TwigTrait
setTwig(Environment $twig)
Environment
getTwig()
RequestTrait
setRequest(Request $request)
Request
getRequest()
ResponseTrait
setResponse(Response $response)
Response
getResponse()
BaseWidget
setName(string $name)
string
getName()
BaseWidget
setTarget(string $target)
string
getTarget()
BaseWidget
setPriority(int $priority)
int
getPriority()
void
injectExtension(ExtensionInterface $extension)
getExtension()
string|null
__invoke(array $params = [])
Method to 'invoke' the widget. Simple wrapper around the 'run' method, which can be overridden in a custom Widget or trait
protected string|null
run(array $params = [])
Actual method that 'runs' the widget and returns the output. For reasons
of extensibility: Do not call directly, but call $widget()
to invoke.