wscore/template

There is no license information available for the latest version (0.1.0) of this package.

A simple template engine using only PHP.

0.1.0 2013-08-23 11:37 UTC

This package is auto-updated.

Last update: 2024-04-28 16:23:11 UTC


README

A simple template engine only with PHP.

  • no parsing.
  • multiple inheritence, like Twig.
  • block, sort of there.
  • automatic output encoding and filters.

Multiple Inheritence

layout.php:

Layout:<?php echo $_v->get( 'content' ); ?>

and you have example.php

<?php $_v->parent( __DIR__ . '/layout.php' ); ?>
test:<?php echo $_v->test;?>

and you run:

$content = $t->render( 'sample.php', array( 'test' => 'This is a sample.' ) );

then you will get:

Layout:test:This is a sample.

To-Do

must think about how to manage lots of filters with ease.