Learning: Template language for PHP developers

This page lists PHP features and their counterpart in the eZ publish template language. With the term "counterpart" we do not mean the usage and features are exactly the same. We just try to list the most similar construct(s).

Variables

PHP

Template language counterpart

$_SERVER

ezservervars

$_GET

ezhttp
ezhttp_hasvariable

$_POST

ezhttp
ezhttp_hasvariable

$_SESSION

ezhttp
ezhttp_hasvariable
session_save
session_load
sessionget
sessionset

$_COOKIE

getCookie

Operators

Arithmetic

PHP

Template language counterpart

+

sum

-

sub

*

mul

/

div

%

mod

Comparison

PHP

Template language counterpart

==

eq

!=

ne

<>

ne

<

lt

>

gt

<=

le

>=

ge

Incrementing/decrementing

PHP

Template language counterpart

++

inc

--

dec

Logical

PHP

Template language counterpart

and

and

or

or

not

not

&&

and

||

or

String

PHP

Template language counterpart

.

concat

.=

concat

Array

PHP

Template language counterpart

===

compare

!==

compare

Control structures

PHP

Template language counterpart

if

if

while

while

do-while

do

for

for

foreach

foreach

switch

switch

Functions

The function index of the PHP manual contains all available PHP functions.

PHP

Template language counterpart

array

array
hash

array_merge

merge

array_push

append

array_reverse

reverse

array_pop

remove

array_shift

remove

array_slice

extract
extract_left
extract_right

array_sum

array_sum

array_unique

unique

array_unshift

prepend

arsort

arsort

asort

asort

explode

explode

get_defined_vars

show_variables

header

redirectrelative
redirectabsolute

htmlentities

wash
encode

implode

implode

in_array

contains

is_null

null

isset

is_set

krsort

krsort

ksort

ksort

mktime

maketime

md5

md5
encode

natcasesort

natcasesort

natsort

natsort

nl2br

nl2br
break

ob_get_clean()

set-block
append-block

preg_replace

reg_ex_replace

rand

rand
randomnum

rsort

rsort

shuffle

shuffle (original shuffle)

sort

sort

str_replace

ezstr_replace

strtolower

downcase

strtoupper

upcase

tidy_parse_string

eztidy

time

currentdate

urlencode

defined by PHPOperatorList
encode