designcise/bitframe-renderer

Simple PHP Template Renderer

v3.5.1 2021-07-22 20:25 UTC

This package is auto-updated.

Last update: 2023-03-23 00:24:41 UTC


README

codecov Build Status

Simple PHP-based templating engine.

Installation

Install using composer:

$ composer require designcise/bitframe-renderer

Please note that this package requires PHP 8.0 or newer.

Usage Example

use BitFrame\Renderer\Renderer;

$renderer = new Renderer([
    'main' => __DIR__ . '/tpl/',
], 'tpl');

$renderer->withData(['foo' => 'bar']);

$output = $renderer->render('main::test', ['baz' => 'qux']);
<!-- ~/tpl/test.tpl -->
<p><?= $foo; ?> <?= $baz; ?></p>

Tests

To run the tests you can use the following commands:

Command Type
composer test PHPUnit tests
composer style CodeSniffer
composer md MessDetector
composer check PHPStan

Contributing

Documentation

Complete documentation for v3 will be available soon.

License

Please see License File for licensing information.