You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access api vars from templates using $this->{api-var-name}
Inside pw template files and all partials included using wireRenderFile($template, $vars) aka $files->render($template, $vars)$this refers to the TemplateFile instance, so we can access api-vars in the following way:
<?phpnamespaceProcessWire;
// Next line add autocompletion for $this/** @var TemplateFile $this */$this->page;
$this->files->render('view/layout.html.php', get_defined_vars());
// etc...
The text was updated successfully, but these errors were encountered:
Access api vars from templates using $this->{api-var-name}
Inside pw template files and all partials included using
wireRenderFile($template, $vars)
aka$files->render($template, $vars)
$this
refers to theTemplateFile
instance, so we can access api-vars in the following way:The text was updated successfully, but these errors were encountered: