PHP templating engines usually define their own syntax. So, to produce HTML you need to learn a new language and use different tools for development. That's something I've always found strange. HTML data is just text and PHP has no trouble manipulating text.

Compare it with software to interact with databases. Then we use PHP components that create a representation of the database elements. These components interface with the database and manipulate the stored data.

We don't write software and ask a database administrator to define all the SQL statements to manipulate the database as she thinks is best. But that's what we're doing with HTML data.

So, why not use PHP directly to create HTML data?

This is what fillum-html does.

fillum-html is a plain PHP component to generate HTML output directly in PHP code. The advantages of using this library over a dedicated templating system:

fillum-html is available on packagist so it's easy to include in your project.