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
snippetforeachelse"{foreach} is used for looping over arrays of data."
60
-
{foreach $${1:array_variable} as $${2:var_or_key}${3: => $${4:itemvar}}}
61
-
${0:${VISUAL}}
62
-
{foreachelse}
63
-
${5}
64
-
{/foreach}
69
+
{foreach $${1:array_variable} as $${2:var_or_key}${3: => $${4:itemvar}}}
70
+
${0:${VISUAL}}
71
+
{foreachelse}
72
+
${5}
73
+
{/foreach}
74
+
endsnippet
65
75
66
76
snippetwh"{while} loops in Smarty have much the same flexibility as PHP while statements, with a few added features for the template engine. Every {while} must be paired with a matching {/while}. All PHP conditionals and functions are recognized, such as ||, or, &&, and, is_array(), etc."
snippetcapture"{capture} is used to collect the output of the template between the tags into a variable instead of displaying it. Any content between {capture name='foo'} and {/capture} is collected into the variable specified in the name attribute. "
snippetfunction"{function} is used to create functions within a template and call them just like a plugin function. Instead of writing a plugin that generates presentational content, keeping it in the template is often a more manageable choice. It also simplifies data traversal, such as deeply nested menus."
snippetinclude"{include} tags are used for including other templates in the current template. Any variables available in the current template are also available within the included template."
snippetliteral"{literal} tags allow a block of data to be taken literally. This is typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter syntax"
snippetsection"A {section} is for looping over sequentially indexed arrays of data, unlike {foreach} which is used to loop over a single associative array. Every {section} tag must be paired with a closing {/section} tag."
snippetstrip"Anything within {strip}{/strip} tags are stripped of the extra spaces or carriage returns at the beginnings and ends of the lines before they are displayed. This way you can keep your templates readable, and not worry about extra white space causing problems."
0 commit comments