doing stuff with smarty
This commit is contained in:
parent
3031feb3d6
commit
3852f95f1f
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,5 +2,6 @@
|
|||||||
*.pid
|
*.pid
|
||||||
docroot/nginx.conf
|
docroot/nginx.conf
|
||||||
docroot/html/writable/*.*
|
docroot/html/writable/*.*
|
||||||
|
docroot/html/templates_c/*.*
|
||||||
docroot/php.ini
|
docroot/php.ini
|
||||||
docroot/session.save_path/sess_*
|
docroot/session.save_path/sess_*
|
||||||
|
@ -2,4 +2,10 @@
|
|||||||
|
|
||||||
require_once("libs/Smarty.class.php");
|
require_once("libs/Smarty.class.php");
|
||||||
|
|
||||||
|
$smarty = new Smarty();
|
||||||
|
$smarty->assign("title", "smarty!");
|
||||||
|
$smarty->assign("bgcolor", "#aef");
|
||||||
|
$smarty->template_dir = "templates";
|
||||||
|
$smarty->display("test.tpl");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
33
docroot/html/templates/test.tpl
Normal file
33
docroot/html/templates/test.tpl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{$title}</title>
|
||||||
|
<style type='text/css'>
|
||||||
|
/*<![CDATA[*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
color: #222;
|
||||||
|
background-color: #eee;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
border: 1px dashed #777;
|
||||||
|
color: #000;
|
||||||
|
background-color: {$bgcolor};
|
||||||
|
padding: 5px;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*]]>*/
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>{$title}</h1>
|
||||||
|
<pre>omg is this really smarty?</pre>
|
||||||
|
</body>
|
||||||
|
</head>
|
0
docroot/html/templates_c/.keep
Normal file
0
docroot/html/templates_c/.keep
Normal file
Loading…
Reference in New Issue
Block a user