forked from feulf/raintpl3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-simple.php
More file actions
35 lines (23 loc) · 780 Bytes
/
Copy pathexample-simple.php
File metadata and controls
35 lines (23 loc) · 780 Bytes
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
<?php
// namespace
use Rain\Tpl;
// include
include "library/Rain/Tpl.php";
// config
$config = array(
"tpl_dir" => "templates/simple/",
"cache_dir" => "cache/"
);
Tpl::configure( $config );
// Add PathReplace plugin (necessary to load the CSS with path replace)
require_once('library/Rain/Tpl/Plugin/PathReplace.php');
Rain\Tpl::register_plugin( new Rain\Tpl\Plugin\PathReplace() );
// create the Tpl object
$tpl = new Tpl;
// assign a variable
$tpl->assign( "name", "Obi Wan Kenoby" );
// assign an array
$tpl->assign( "week", array( "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ) );
// draw the template
$tpl->draw( "simple_template" );
?>