duster/js/test_cases/reference_parameters/main.dust

56 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-05-30 19:20:54 +00:00
Hello {name}, nice {pet}{~n}
{#people}
Hello {name}, nice {pet}{~n}
{/people}
{#people name="chris" pet="cat"}
Hello {name}, nice {pet}{~n}
{/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}
2020-05-30 19:20:54 +00:00
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}
{! Can you go through multiple levels of references !}
{#truthy name="chris" pet="{petname}" petname="{deeperpetname}" deeperpetname="fluffy"}
Hello {name}, nice {pet}{~n}
{/truthy}