SnippetWidget
class SnippetWidget extends BaseWidget (View source)
Traits
Properties
protected | $name | ||
protected | $target | ||
protected | $zone | ||
protected ExtensionInterface | $extension | from BaseWidget | |
protected | $priority | ||
protected string | $template | from BaseWidget | |
protected string | $templateFolder | from BaseWidget | |
protected ?string | $slug | from BaseWidget | |
protected int | $cacheDuration | from BaseWidget | |
protected | $type |
Methods
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
from
BaseWidget
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.
__construct(string $snippet = '<!-- snippet -->', string $name = 'Nameless Snippet', string $target = Target::NOWHERE, string $zone = RequestZone::NOWHERE)
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.