Sponsored Link

Quick Start

Extension of the template files can be anything. It is recommended [.tpl] for clarity.

PHP

PHP source

<?php
// Load class
require_once('OnePlate.php');

// It defines an array of variables to be assigned to the template
$assign = array();
$assign['sample_echo'] = 'Hello World';

// Create an instance
$op = new OnePlate();

// Assign variables, Render HTML
$op->render('sample.tpl', $assign);

?>

Template

Template source (sample.tpl)

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div>variable is {{ sample_echo }}</div>
</body>
</html>

Result

variable is Hello World