Skip to content

🌴 Simple template class for rendering a view with some context

License

Notifications You must be signed in to change notification settings

palmtreephp/template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palmtree PHP Template

Templating component for Palmtree PHP

Usage

<?php
use Palmtree\Template\Template;

$template = new Template('front-page.php');

$template['document_title'] = 'Hello World Site';
$template['heading']        = 'Hello World';
$template['content']        = '<p>Welcome to the Hello World site</p>';

echo $template;
<!-- front-page.php -->
<!doctype html>
<html>
<head>
    <title><?php echo $document_title; ?></title>
</head>
<body>
<main>
    <h1><?php echo $heading; ?></h1>
    <?php echo $content; ?>
</main>
</body>
</html>

License

Released under the MIT license

About

🌴 Simple template class for rendering a view with some context

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages