starstar

star is a Simple Templates And Renderer script for PHP  to produce web pages from HTML templates.  Unlike virtually every other contemporary PHP template engine, star has zero dependencies, and does not require Composer and ten million other files and folders of unknown provenance.  It is a single file, consisting of less than 500 lines of code, and you can paste it right into your existing script.  It's not going to win any awards or accolades, because it bucks all the trendy things, just efficiently doing the job it was designed for.

Concept:

star was created so I can occasionally create PHP Web applications that make use of HTML templates. star has no dependencies other than PHP itself, and uses no frameworks.  It is intended to be used via a require_once() or pasted into a script.  star caches the result of template processing as PHP to maximize performance.  It supports Twig-style inheritance, variables, includes, and conditionals. It escapes output to protect against XSS attacks.

Documentation:

Support:

You can ask for help with star on the mailing list.

License, Documentation:

View the current: README License (GPL 2 or later)

Version history:

Requirements, Download(s):

Requires PHP-CLI 7.3 or greater.   The PHP needs to have PCRE compiled in or loaded as an extension.  Virtually all PHP installations meet this requirement. 

Mailing List

Mailing list | Archives

Home