Thanks for the reply, but this only works for setVars (as expected).
class SessionController extends ControllerBase
{
public function indexAction()
{
$this->view->setVar("test_key", 'test_value');
if (!$this->request->isPost()) {
Tag::setDefault('email', '[email protected]');
Tag::setDefault('password', 'phalcon');
}
}
}
I would like to catch email and password. My injection to dispatcher in main (bootstrap) file:
$di->set('view', function() use ($config, $di) {
$eventsManager = $di->getShared('eventsManager');
$eventsManager->attach('view:beforeRender', function($event, $view) {
var_dump($view->getParamsToView()); // 'test_value' here OK
});
$view = new \Phalcon\Mvc\View();
$view->setViewsDir(__DIR__ . $config->application->viewsDir);
$view->registerEngines(array(
".volt" => 'volt'
));
$view->setEventsManager($eventsManager);
return $view;
});
There are no method in static Tag class such as getParams or something. I'm tried to find it in DI tag service too.