I am happy to annouce the 2.0 release of Qiq templates for PHP 8.

Qiq is for developers who prefer native PHP templates, but with less verbosity. It offers:

This release incorporates several substantial changes; you can see the upgrade notes here.

The most important of these changes is that Qiq templates are now easily subject to static analysis. Add a docblock typehint for $this in your template files, recompile any templates using Qiq syntax, and run your static analyzer against your templates. Yes, it's that easy.

The way helpers are implemented has also changed. Previously, you would have to register your helper class with a helper locator, but that made static analysis more difficult. As of this release, helpers are now just methods on a Helpers class, which makes static analysis simple and straightforward. To add a helper, extend the Helpers class and write any method you like. In addition, all helper objects are retained in a PSR-11 container object; use the lightweight Container provided by Qiq, or bring your own (maybe Capsule).

Finally, a Twig-like implementation of "blocks" and "inheritance" has been added to this release, and backported to the latest 1.x release.

If you're a Twig user looking to branch out, or if you like native PHP templates but want something a little more concise, try Qiq!

Are you stuck with a legacy PHP application? You should buy my book because it gives you a step-by-step guide to improving you codebase, all while keeping it running the whole time.