duster/js/test_cases/reference_parameters/main.dust
2020-05-30 15:20:54 -04:00

53 lines
1.4 KiB
Plaintext

Hello {name}, nice {pet}{~n}
{#people}
Hello {name}, nice {pet}{~n}
{/people}
{#people name="chris" pet="cat"}
Hello {name}, nice {pet}{~n}
{/people}
Reference Parameters{~n}
===================={~n}
{#people name="chris" pet="{petname}" petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/people}
{#people}
{#truthy name="chris" pet="{petname}" petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/truthy}
{/people}
{#people name="chris" pet="{petname}" petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}
{! Can you have additional text in reference parameters, or just the reference !}
{#people name="chris" pet="{petname}!" petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}
{! Can you have filters !}
{#people name="chris" pet="{petname|js}" petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}
Direct Parameters{~n}
================={~n}
{#people name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/people}
{#people}
{#truthy name="chris" pet=petname petname="whiskers"}
Hello {name}, nice {pet}{~n}
{/truthy}
{/people}
{#people name="chris" pet=petname petname="whiskers"}
{#other_petname}
Hello {name}, nice {pet}{~n}
{/other_petname}
{/people}