How to pass a variable from Pressenter to latte template
- asinkan
- Member | 38
Hello,
I have a function in the DashboardPresenter. This function calls template MyTempla
public function myFormSucceeded($button)
{
$this->template->name = $button->getForm()->getValues();
$this->redirect('myTempla');
}
how can I send my data to myTempla template?
{block content}
<h1>{$name}</h1>
I can set it in the render, but how to pass it to the render and how to call render?
public function renderMyTempla()
{
$this->template->name=....;
}
Thx
Last edited by asinkan (2018-01-26 10:57)
- David Matějka
- Moderator | 6445
when you redirect, variables passed to a template are lost. so either don't redirect or pass variables via url (or session)