* tiaxgame {% set data='a/b/c'|split('/') %}
{% set i=1 %}
{{data[i]}}

I want output = "b" (with 'var name' "i")
2014-05-28 03:18 · (0)
* Graham * tiaxgame That code already works the output is "b" !
or do you want to output it like "b[1]"
{{data[i]}}[{{i}}]
or "b[i]"
{{data[i]}}[i]
2014-05-28 08:30 (edited 2014-05-28 10:46 by Graham ) · (0)
* tiaxgame * Graham ok!
2014-05-28 10:48 · (0)
* tiaxgame * Graham I want creat a "loop" with tag 'for' as 'xtscript'
But i'm not know,
{% set i=0 %}
{% for ??? %}
{% set i %>{{i+1}}{% endset %}
{{i}}
If i>10
Stop
Endif
Endfor
2014-05-28 10:55 · (0)
* Graham * tiaxgame in a way it is a lot simpler than xtscript :)
{% for i in 0..10 %}
    * {{ i }}
{% endfor %}

Copy code

http://twig.sensiolabs.org/doc/tags/for.html
2014-05-28 11:30 · (0)
* tiaxgame * Graham Ok, thanks. Now, I
have problems with
paging. I have the
current page {{p}}
and {{laughter}}
pend. Please write
classified as paging
forums
2014-05-29 03:28 · (0)
* tiaxgame * Graham i want to change 'string' -> "number"
{% set a="2" %}
{{a+1}}
I want: output = 3 (the number)
2014-05-30 07:54 · (0)
* Graham * tiaxgame I just tested
{% set a="2" %}
{{a+1}}
and the output is 3
2014-05-30 08:55 · (0)
* tiaxgame * Graham Ok.
I want to used 'encode' and 'decode' of "base64"
, "chr", "sha1", ... etc.
2014-05-31 11:40 · (0)
* Graham * tiaxgame I do not think twig has those functions
2014-05-31 11:57 · (0)

Online: Guests: 1