Additions:
===Smarty Sample App===
http://www.smarty.net/sampleapp/sampleapp_p1.php
http://www.smarty.net/sampleapp/sampleapp_p1.php
Additions:
http://www.smarty.net/manual/en/language.function.php.php
Additions:
===Create PHP Smarty test file===
$ cd webroot (ie /var/www/)
$ vi smarty.php
$ vi smarty.tpl
Hello {$name}!
$ cd webroot (ie /var/www/)
$ vi smarty.php
$ vi smarty.tpl
Hello {$name}!
Deletions:
// put full path to Smarty.class.php
vi /var/local/smarty/templates/smarty.tpl
Hello, {$name}!
Additions:
$smarty->template_dir = dirname(__FILE__) ;
Deletions:
Additions:
vi /var/www/smarty.php
%%(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>
%%(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