Welcome to Template Engine Demo
Here you can learn about how to do the view part in MVC with DooPHP using its template engine.
IF statement is SUPPORTED now. You can use partial caching mechanism with the tempalte engine too!
View the template source (html).
This is include with a variable.
This is include file nested in sub folder.
This is from a included template in a sub folder. view/nested/hi.html Variable value: Hello! DooPHP
View test, variable, tags, loop, loop assoc array, double loop:
Username: doodemoUsername upper case: DOODEMO
Hi doodemo! welcome back.
Using a function in template_tags.php to print_r. You control what you want to be available in the template.
Array
(
[0] => Please callback, thanks.
[1] => $1000 cash to earn
[2] => Supernova photos
[3] => Weather today is very hot!
)
Messages list:
Just a simple loop
- Please callback, thanks.
- $1000 cash to earn
- Supernova photos
- Weather today is very hot!
User name list:
Functions can be used in loop
- KEE : LEE KEE SENG
- JOHN : JOHN SMITH
Full name for user john:
John SmithFull name for user john UPPER case:
JOHN SMITHTotal user:
Associative array usage
Male = 100.00Female = 301
Female = 301 with args: we female
Female = 1903 ( 301 x3 female + 1000 )
Kids Male = 60
Kids Female = 201
Teen Male = 40
Teen Female = 100
User's messages list:
Nested loop example
-
leng :
- (0) Please callback, thanks.
- (1) $1000 cash to earn
- (2) Supernova photos
- (3) Weather today is very hot!
- (0) Hi google
- (1) I am so happy now!
- (2) cool day huh?
- (0) Hi google
- (1) I am so happy now!
- (2) cool day huh?
- (0) Hi google
- (1) I am so happy now!
- (2) cool day huh?
- (0) Hi google
- (1) I am so happy now!
- (2) cool day huh?
- (0) Hi google
- (1) I am so happy now!
- (2) cool day huh?
john :
john2 :
john3 :
john4 :
john5 :
Messages with detail:
Nested loop with Assoc array example
- COOL STUFF ON MY DOORMAT ATTACH: benchmark.pdf
- MESSAGE 2 HERE HI! ATTACH:
The Winner is:
Using objects
Winner name: Mr. ObjectGender: unisex
Winner's Physical Profile:
Weight: 562
Height: 180
Winners list:
Using objects in loop
- MR. OBJECT 0
Gender: unisex
Weight: 342
Height: 162 - MR. OBJECT 1
Gender: unisex
Weight: 234
Height: 168 - MR. OBJECT 2
Gender: unisex
Weight: 567
Height: 159 - MR. OBJECT 3
Gender: unisex
Weight: 335
Height: 189
winners' value, loop' value, loop' v, l' v, somename' v are the same
Loop Blog post with tags
This is a title 0
Read this content 0
tag0,
tag1,
tag2,
This is a title 1
Read this content 1
tag0,
tag1,
tag2,
This is a title 2
Read this content 2
tag0,
tag1,
tag2,