Additions:
Additions:
Additions:
Create PHP Smarty test file
$ cd webroot (ie /var/www/)
$ vi smarty.php
$ vi smarty.tpl
Hello {$name}!
Deletions:
vi /var/www/smarty.php
put full path to Smarty.class.php
vi /var/local/smarty/templates/smarty.tpl
Hello, {$name}!
Additions:
$smarty->template_dir = dirname(FILE) ;
Deletions:
$smarty->template_dir = '/var/local/smarty/templates';
Additions:
vi /var/www/smarty.php
<?php
// put full path to Smarty.class.php
require 'smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = '/var/local/smarty/templates';
$smarty->compile_dir = '/var/local/smarty/templates_c';
$smarty->cache_dir = '/var/local/smarty/cache';
$smarty->config_dir = '/var/local/smarty/configs';
$smarty->assign('name', 'GNU LINUX');
$smarty->display('smarty.tpl');
?>
vi /var/local/smarty/templates/smarty.tpl
(smarty)
<html>
<head>
<title>Smarty</title>
</head>
<body>
Hello, {$name}!
</body>
</html>
No differences.
Smarty Templates
How to Install Smarty Securely
download smarty
untar/unzip smarty
put smarty library OUTSIDE docroot but in php include path
# mkdir /usr/share/php
# mv smarty/libs/ /usr/share/php/smarty
put smarty tempfiles OUTSIDE docroot
# cd /var/local
# mkdir smarty
# mkdir smarty/templates
# mkdir smarty/templates_c
# mkdir smarty/cache
# mkdir smarty/configs
# chown -R apache:apache smarty
%%
REFERRERS
FsseFrameworks