Sets a variable in the parser. After defining the variable as="somevar", you can use it via $somevar.
Attributes
as
string
The name of the variable to be registered
value
string
The value of the variable
Examples
Set a variable
Value is normally set to an API call to retrieve an object such as a Page, Post or Contact.
HTML:
<logic:variable value="[? \Components\Website\Pages::current() ?]" as="page" />
After setting variable $page, render the page title as a heading:
<h1>[? $page['page_title'] ?]</h1>
Hint: View the data stored in a variable with in-line PHP:
[? varDump($page) ?]