My development blog about PHP, Nette Framework, ElasticSearch or occasional short tips.
https://api.nette.org/2.4/source-Application.UI.Control.php.html#42-56
/** @var Nette\Bridges\ApplicationLatte\Template $template **/
$template = $this->getTemplate();
https://api.nette.org/2.4/source-Bridges.ApplicationLatte.Template.php.html#141-152
$template->add($name, $value);
If you are using BasePresenter as parent to all your presenters you can modify function getTemplate()
/**
* @return Nette\Application\UI\ITemplate|Nette\Bridges\ApplicationLatte\Template
*/
public function getTemplate()
{
return parent::getTemplate();
}
And now you can use this and your IDE will auto-suggest add() after getTemplate()
$this->getTemplate()->add($name, $value);