update
Former-commit-id: bdede6ed1b6f578f2ef046c338caf02d0b29d453 [formerly 7187de361b53e9c8ec121df379b762f2db736ea2] Former-commit-id: 447d58460fbbfd05ffe08428a1288e392637561d
This commit is contained in:
46
_embed/public/ace/demo/kitchen-sink/docs/soy_template.soy
Normal file
46
_embed/public/ace/demo/kitchen-sink/docs/soy_template.soy
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Greets a person using "Hello" by default.
|
||||
* @param name The name of the person.
|
||||
* @param? greetingWord Optional greeting word to use instead of "Hello".
|
||||
*/
|
||||
{template .helloName #eee}
|
||||
{if not $greetingWord}
|
||||
Hello {$name}!
|
||||
{else}
|
||||
{$greetingWord} {$name}!
|
||||
{/if}
|
||||
{/template}
|
||||
|
||||
/**
|
||||
* Greets a person and optionally a list of other people.
|
||||
* @param name The name of the person.
|
||||
* @param additionalNames The additional names to greet. May be an empty list.
|
||||
*/
|
||||
{template .helloNames}
|
||||
// Greet the person.
|
||||
{call .helloName data="all" /}<br>
|
||||
// Greet the additional people.
|
||||
{foreach $additionalName in $additionalNames}
|
||||
{call .helloName}
|
||||
{param name: $additionalName /}
|
||||
{/call}
|
||||
{if not isLast($additionalName)}
|
||||
<br> // break after every line except the last
|
||||
{/if}
|
||||
{ifempty}
|
||||
No additional people to greet.
|
||||
{/foreach}
|
||||
{/template}
|
||||
|
||||
|
||||
{/foreach}
|
||||
{if length($items) > 5}
|
||||
{msg desc="Says hello to the user."}
|
||||
|
||||
|
||||
{namespace ns autoescape="contextual"}
|
||||
|
||||
/** Example. */
|
||||
{template .example}
|
||||
foo is {$ij.foo}
|
||||
{/template}
|
||||
Reference in New Issue
Block a user