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:
<?php namespace ProcessWire;
// Next line add autocompletion for $this
/** @var TemplateFile $this */
$this->page;
$this->files->render('view/layout.html.php', get_defined_vars());
// etc...
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: