biurad / templating
A library that provides all the tools needed in working with any kind of template system
Fund package maintenance!
Patreon
biurad.com/sponsor
Installs: 1 249
Dependents: 4
Suggesters: 4
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- php: ^7.1 || ^8.0
Requires (Dev)
- composer/package-versions-deprecated: ^1.8
- phpstan/phpstan: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- phpunit/phpunit: ^8.5 || ^9.0
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^3.11
This package is auto-updated.
Last update: 2024-12-01 00:07:15 UTC
README
The Biurad PHP Template UI
biurad/php-templating is server side template ui for PHP 7.2+ created by Divine Niiquaye. This library provides all the tools needed in working with any kind of template system and offers a structured solution to implement server side renderable template engines (Twig, Stempler, Latte, Blade, or native PHP templates) segregation.
๐ฆ Installation & Basic Usage
This project requires PHP 7.2 or higher. The recommended way to install, is via Composer. Simply run:
$ composer require biurad/templating
This library is shipped out of the box with three high performance and dynamic renders for fast server side templating. It also support multiple rendering (can render templates declared for different renderers all at once).
Again you don't have to worry about declaring absolute path to every single template file. Set the storage to where paths can be found, enter the name of the template file. The rest will be taken care of return the rendered result (ultimate HTML).
use Biurad\UI\Renders\PhpNativeRender; use Biurad\UI\Helper\SlotsHelper; use Biurad\UI\FilesystemStorage; use Biurad\UI\Template; $filesystemLoader = new FilesystemStorage(__DIR__.'/views'); $templating = new Template($filesystemLoader); // Before adding a template renderer, you can add a namespace path // $templating->addNamespace('MyBundle', __DIR__ . '/vendor/company/package/Resources'); // Add a template compiler renderer to Template. $phpRenderEngine = new PhpNativeRender(); $templating->addRender($phpRenderEngine); // You can also render an absolute path except for the fact that, it is not cacheable. echo $templating->render('hello', ['firstname' => 'Divine']); // hello.phtml or hello.php or hello.html Hello, <?= $this->escape($firstname) ?>!
๐ Documentation
For in-depth documentation before using this library.. Full documentation on advanced usage, configuration, and customization can be found at docs.divinenii.com.
โซ Upgrading
Information on how to upgrade to newer versions of this library can be found in the UPGRADE.
๐ท๏ธ Changelog
SemVer is followed closely. Minor and patch releases should not introduce breaking changes to the codebase; See CHANGELOG for more information on what has changed recently.
Any classes or methods marked @internal
are not intended for use outside of this library and are subject to breaking changes at any time, so please avoid using them.
๐ ๏ธ Maintenance & Support
(This policy may change in the future and exceptions may be made on a case-by-case basis.)
- A new patch version released (e.g.
1.0.10
,1.1.6
) comes out roughly every month. It only contains bug fixes, so you can safely upgrade your applications. - A new minor version released (e.g.
1.1
,1.2
) comes out every six months: one in June and one in December. It contains bug fixes and new features, but it doesnโt include any breaking change, so you can safely upgrade your applications; - A new major version released (e.g.
1.0
,2.0
,3.0
) comes out every two years. It can contain breaking changes, so you may need to do some changes in your applications before upgrading.
When a major version is released, the number of minor versions is limited to five per branch (X.0, X.1, X.2, X.3 and X.4). The last minor version of a branch (e.g. 1.4, 2.4) is considered a long-term support (LTS) version with lasts for more that 2 years and the other ones cam last up to 8 months:
Get a professional support from Biurad Lap after the active maintenance of a released version has ended.
๐งช Testing
$ ./vendor/bin/phpunit
This will tests divineniiquaye/php-rade will run against PHP 7.4 version or higher.
๐๏ธ Governance
This project is primarily maintained by Divine Niiquaye Ibok. Contributions are welcome ๐ทโโ๏ธ! To contribute, please familiarize yourself with our CONTRIBUTING guidelines.
To report a security vulnerability, please use the Biurad Security. We will coordinate the fix and eventually commit the solution in this project.
๐ Sponsors
Are you interested in sponsoring development of this project? Reach out and support us on Patreon or see https://biurad.com/sponsor for a list of ways to contribute.
๐ฅ Credits & Acknowledgements
๐ License
The divineniiquaye/php-rade library is copyright ยฉ Divine Niiquaye Ibok and licensed for use under the .