how to load cache variables into templates

2 years ago

alnux
Member | 106
+
0
-

The question is how to load cache variables (made into presenters side) into latte templates, there is a {cache} macros but i dont understand at all the documentantion.

thanks

Last edited by alnux (2017-05-22 17:20)

2 years ago

matopeto
Member | 400
+
+1
-

Hmm.. as normal variable?

// Retrieve your variable from cache in presenter
$value = $cache->load($key);

// Send it to template
$this->template->cachedVariable = $value;

Last edited by matopeto (2017-05-22 17:45)