designcise/bitframe-renderer

Simple PHP Template Renderer

v4.0.0 2023-07-01 23:53 UTC

This package is auto-updated.

Last update: 2024-03-30 00:21:27 UTC


README

CI Maintainability Test Coverage

Simple PHP-based templating engine.

Installation

Install using composer:

$ composer require designcise/bitframe-renderer

Please note that this package requires PHP 8.2 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.