edition-php-twig-standard
edition-php-twig-standard copied to clipboard
equivalent to pattern parameters in twig version?
Can anyone tell me what the equivalent twig syntax/functionality would be for pattern parameters from the mustache version?
http://patternlab.io/docs/pattern-parameters.html
I have been doing a little bit of digging in the twig docs, but for now can't seem to find the a good way to pass variables from say a molecule to a referenced atom.
Update: found the (quite obvious) place in the twig docs: http://twig.sensiolabs.org/doc/tags/include.html
@simonerlandsen This isn't working for me. Did you get it working?
My code:
{# primary-nav.twig #}
{% set nav_class = "navbar-nav" %}
...
<ul class="{{ nav_class }}">
{# header.twig #}
{% include "molecules-primary-nav" with { 'nav_class': 'navbar' } %}
The value of nav_class
in header.twig
after compiling is still "navbar-nav".