My favorites | Sign in
Project Logo
                
Search
for
Updated May 22, 2008 by alex.aperez
Labels: Featured
Temper  

#Temper (Kohana Template Parser Module) Documentation

Introduction

Just a brief introduction to the module and it's usage.

Syntax

Temper 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 Tags

Temper 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
Hosted by Google Code