github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/flosch/pongo2.v3/template_tests/with.tpl (about)

     1  new style
     2  Start '{% with what_am_i=simple.name %}I'm {{what_am_i}}{% endwith %}' End
     3  Start '{% with what_am_i=simple.name %}I'm {{what_am_i}}11{% endwith %}' End
     4  Start '{% with number=7 what_am_i="guest" %}I'm {{what_am_i}}{{number}}{% endwith %}' End
     5  Start '{% include "with.helper" with what_am_i=simple.name number=10 %}' End
     6  
     7  old style - still supported by Django
     8  Start '{% with simple.name as what_am_i %}I'm {{what_am_i}}{% endwith %}' End
     9  Start '{% with simple.name as what_am_i %}I'm {{what_am_i}}11{% endwith %}' End
    10  Start '{% with 7 as number "guest" as what_am_i %}I'm {{what_am_i}}{{number}}{% endwith %}' End
    11  Start '{% include "with.helper" with what_am_i=simple.name number=10 %}' End
    12  
    13  more with tests
    14  {% with first_comment=complex.comments|first %}{{ first_comment.Author }}{% endwith %}
    15  {% with first_comment=complex.comments|first %}{{ first_comment.Author.Name }}{% endwith %}
    16  {% with first_comment=complex.comments|last %}{{ first_comment.Author.Name }}{% endwith %}