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
According to Twigpress doc and sprig-dir/inc/twigpress.php, you can pass variables to the template with twigpress_render_twig_template($vals = array(), $template = false, $echo = true).
I'm trying to pass variables to the template with the following code but it doesn't work. What am I doing wrong?
According to Twigpress doc and sprig-dir/inc/twigpress.php, you can pass variables to the template with twigpress_render_twig_template($vals = array(), $template = false, $echo = true).
I'm trying to pass variables to the template with the following code but it doesn't work. What am I doing wrong?
single.php:
$vals = array( 'foo' => 'bar' );
twigpress_render_twig_template($vals);
single.twig:
{{ vals.foo }} # Does not print anything #
{{ foo }} # Same #
{{ dump(vals) }} # Prints 'null' #
Please enlighten a n00b! Thanks. :)
The text was updated successfully, but these errors were encountered: