/**
* Sets several pieces of view data at once.
*
* @param string|null $context The context to escape it for: html, css, js, url
* If null, no escaping will happen
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
*/
public function setData(array
$data =
[], ?string
$context = null
): RendererInterface
{ if ($context) { $data = \
esc($data,
$context);
} $this->tempData ??=
$this->data;
$this->tempData =
array_merge($this->tempData,
$data);
return $this;
} /**
* Sets a single piece of view data.
*
* @param mixed $value
* @param string|null $context The context to escape it for: html, css, js, url
* If null, no escaping will happen
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
*/