FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
raintpl/cache_example.php at master · feulf/raintpl · GitHub
feulf
/
raintpl
Public
Notifications
You must be signed in to change notification settings
Fork
45
Star
186
Code
Issues
6
Pull requests
3
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
raintpl
/
cache_example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (34 loc) · 1.19 KB
Breadcrumbs
raintpl
/
cache_example.php
Copy path
File metadata and controls
47 lines (34 loc) · 1.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
//include the RainTPL class
include
"
inc/rain.tpl.class.php
"
;
raintpl::
configure
(
"
base_url
"
,
null
);
raintpl::
configure
(
"
tpl_dir
"
,
"
tpl/
"
);
raintpl::
configure
(
"
cache_dir
"
,
"
tmp/
"
);
//initialize a Rain TPL object
$
tpl
=
new
RainTPL
;
if
(
$
cache
=
$
tpl
->
cache
(
'
page
'
,
60
,
1
) )
echo
$
cache
;
else
{
//variable assign example
$
variable
=
"
Hello World!
"
;
$
tpl
->
assign
(
"
variable
"
,
$
variable
);
//loop example
$
week
=
array
(
'
Monday
'
,
'
Tuersday
'
,
'
Wednesday
'
,
'
Friday
'
,
'
Saturday
'
,
'
Sunday
'
);
$
tpl
->
assign
(
"
week
"
,
$
week
);
//loop example 2
$
user
=
array
(
array
(
'
name
'
=>
'
Jupiter
'
,
'
color
'
=>
'
yellow
'
),
array
(
'
name
'
=>
'
Mars
'
,
'
color
'
=>
'
red
'
),
array
(
'
name
'
=>
'
Earth
'
,
'
color
'
=>
'
blue
'
),
);
$
tpl
->
assign
(
"
user
"
,
$
user
);
//loop example with empty array
$
tpl
->
assign
(
"
empty_array
"
,
array
() );
$
info
=
array
(
'
title
'
=>
'
Rain TPL Example
'
,
'
copyright
'
=>
'
Copyright 2006 - 2011 Rain TPL<br>Project By Rain Team
'
);
$
tpl
->
assign
(
$
info
);
global
$
global_variable
;
$
global_variable
=
'
This is a global variable
'
;
//draw the template
echo
$
tpl
->
draw
(
'
page
'
,
$
return_string
=
true
);
}
?>
Back
|
FazBrowse Home
|
New Git URL