Wednesday, August 28, 2013

PHP Savant template



Savant is a powerful but lightweight object-oriented template system for PHP.
Savant is used Atutor LMS etc.Savant3 can be downloaded from
http://phpsavant.com/
Example: example.php
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require($_SERVER['DOCUMENT_ROOT'].'/_classes/Savant3/Savant3.php');
$tpl = new Savant3();
// Directly assgn  $tpl->title
$tpl->title = 'My Page Title';
$tpl->display('assign.tpl.php');
?>

template file:  assign.tpl.php
<html>
    <head>
        <title><?php echo $this->eprint($this->title); ?></title>
        <?php echo $this->eprint($this->title); ?>
    </body>
</html
>

Video: PHP Savant template

No comments:

Post a Comment