-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
45 lines (34 loc) · 935 Bytes
/
INSTALL
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
OOTEMPLATE INSTALLATION OVERVIEW
Quick Start
-----------
an example of an arborescence :
www
|- /libs
|- /ootemplate
|- /others
|- /models
|- /views
|- default.tpl
|- /controllers
|- default.php
|- /htdocs
|- index.php
<?php
// index.php
# Configure a path of ootemplate libs
ini_set ('include_path',
ini_get ('include_path').':'.dirname (__FILE__).'/../lib:');
# Configure a settings
OOTemplate_Setting::$dir_html = '../views';
OOTemplate_Setting::$suffix = '.tpl';
?>
<?php
// www/controllers/default.php
# Create a new instance of ootemplate
$ootemplate = new OOTemplate ();
$context = $ootemplate->getContext ();
# set a new var in a context of template
$context->set ('var_hello', 'Hello World');
# output, return a displayed contents of default.tpl
echo $ootemplate->render ('default');
?>