|
Temper
#Temper (Kohana Template Parser Module) Documentation IntroductionJust a brief introduction to the module and it's usage. SyntaxTemper uses three types of delimiters, {}, {{}}, <prefix:tag></prefix:tag> The first one indicates a variable string, second represents function calls and third type identyfies predefined tags. Variables
Functions
Predefined TagsTemper defines tags as objects, each tag should extend Temper_Tag class, but there are some exceptions where Tags extend another Tags. You can write your own tags, but there are some bundled with the module. if-elseif-else <ko:if var="a" eq="a">a
<ko:elseif var="a" eq="b" />b
<ko:elseif var="a" neq="">set
<ko:else />not set</ko:if>for <ko:for var="x" start="1" end="10" increment="1">
<ko:for var="y" start="1" end="10" increment="1">
<ko:print>$x * $y</ko:print>
</ko:for>
</ko:for>foreach <ko:foreach var="tags" key="key" val="tag">
<a href="{/search/=tag/}" title="{=tag}">{=tag}</a>
</ko:foreach>switch <ko:switch var="a">
<ko:case val="a"><li>a</li></ko:case>
<ko:case val="b"><li>b</li></ko:case>
</ko:switch>
|
Sign in to add a comment