Skip to content
Grav 2.0 is officially stable. Read the announcement →

Muut Archive Legend

@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation

Badges

✏️ First Post 💬 Conversation Starter ❤️ Well Liked

Recent posts

  • Creating Helper Function · 11 years ago

    Can you provide an example? I guess your variable config.brain.adjectives is empty. Where did you put this into? Check it with {{ dump(config.brain.adjectives) }}. You should see a value in the debug

  • Creating Helper Function · 11 years ago

    does not work properly.... :(

  • Creating Helper Function · 11 years ago

    Hi @timomue, ok it really depends on what type is your variable in config.brain.adjectives. According to the docs If it is an array like {{ random(['apple', 'orange', 'citrus']) }} it will for example

  • Creating Helper Function · 11 years ago

    twig's output is a string full of random numbers !?!?!?

  • Creating Helper Function · 11 years ago

    It doesn't work for me!

  • Creating Helper Function · 11 years ago

    {% set adjective = random(config.brain.adjectives) %} Is there a problem?

  • Creating Helper Function · 11 years ago

    i've got it, thanks!

  • Creating Helper Function · 11 years ago

    how to call a macro from within a twig file ?

  • Creating Helper Function · 11 years ago

    yeah, Sommerregen! danke schön !

  • Creating Helper Function · 11 years ago

    See for example http://twig.sensiolabs.org/doc/advanced.html#filters . You may also do it in pure Twig with the below snippet (probably needs some improvments though) {% set hour = "now"|date("g")|nu