piedweb/splates

Splates, a native PHP template inspired by twig system that's fast, easy to use and easy to extend.

dev-main 2024-12-16 19:02 UTC

This package is auto-updated.

Last update: 2024-12-16 19:02:23 UTC


README

WIP : fork of league/plates. The main goal is to enable PHPStan support for templates and ensure IDE code completion works seamlessly without additional effort.

Maintainer Source Code Latest Version Software License Build Status Quality Score Total Downloads

Splates is a native PHP template system that's fast, easy to use and easy to extend. It's inspired by the excellent Twig template engine and strives to bring modern template language functionality to native PHP templates. Splates is designed for developers who prefer to use native PHP templates over compiled template languages.

Highlights

  • Native PHP templates, no new syntax to learn
  • ... coming with native IDE autocompletion and static analysis without extra work to your templates
  • Plates is a template system, not a template language
  • Increase code reuse with template layouts and inheritance
  • Data sharing across templates
  • Preassign data to specific templates
  • Built-in escaping helpers
  • Framework-agnostic, will work with any project. Heavily tested with Symfony.
  • Decoupled design makes templates easy to test
  • Composer ready and PSR-2 compliant

Dropped feature from league/plates

  • Drop insert ➜ prefer <?=$f(...)?>
  • Drop uri extension
  • Simplify internal api dropping a lot of get* and set* for public method

Installation

Splates is available via Composer:

composer require piedweb/splates

Documentation

Full documentation is not writed yet. Look at plates docs .

Developpment

composer test
composer format
composer stan
composer rector

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.