designcise / bitframe-renderer
Simple PHP Template Renderer
v4.0.0
2023-07-01 23:53 UTC
Requires
- php: >=8.2
Requires (Dev)
- phpmd/phpmd: @stable
- phpstan/phpstan: *
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: 3.*
README
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
- File issues at https://github.com/designcise/bitframe-renderer/issues
- Issue patches to https://github.com/designcise/bitframe-renderer/pulls
Documentation
Complete documentation for v3 will be available soon.
License
Please see License File for licensing information.