accessing simpleCache from templates

tenants

Well-known member
For sessions, there is no need to added anything to the controller/model/view since the session can be accessed from a template as:

{$session.x}

for example:
Code:
<xen:if is="!{$session.robotId}">
   Xenforo has not detected me as a crawler
</xen:if>

Is there something similar for simpleCache (since its globally fetched and requires 0 query overhead)
Or do I have to push something in the controller every time I need to access simpleCache in a template ?
 
Yes:
Code:
{$xenCache.key}

e.g.

Code:
<xen:if is="{$xenCache.userUpgradeCount}"><li><a
    class="{xen:if "{$selectedKey} == 'account/upgrades'", 'secondaryContent', 'primaryContent'}"
    href="{xen:link account/upgrades}">{xen:phrase account_upgrades}</a></li></xen:if>
 
Incidentally you can see default template params by going to:
XenForo_Dependencies_Abstract::preRenderView();

They will apply to public and admin templates.

Then there's some Admin/Install/Public specific ones too.
 
Back
Top Bottom