Blog Spameri

My development blog about PHP, Nette Framework, ElasticSearch or occasional short tips.

Project maintained by Spamercz Hosted on GitHub Pages — Theme by mattgraham

1. Get template

/** @var Nette\Bridges\ApplicationLatte\Template $template **/
$template = $this->getTemplate();

2. Set Up parameter

$template->add($name, $value);

3. Bonus

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);

Back to index RSS

Posted: 03 Jan 2017