palmtree / template
Template component for Palmtree PHP
v1.0.0
2017-11-12 00:49 UTC
Requires
- palmtree/argparser: ~1.0
This package is auto-updated.
Last update: 2024-11-19 10:07:55 UTC
README
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