{
    "href": "/post/2021/10/20/qiq-templates-for-php-8/",
    "relId": "2021/10/20/qiq-templates-for-php-8",
    "title": "Qiq Templates for PHP 8",
    "author": "pmjones",
    "tags": [
        {
            "href": "/tag/programming/",
            "relId": "programming",
            "title": "Programming",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/php/",
            "relId": "php",
            "title": "PHP",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/qiq/",
            "relId": "qiq",
            "title": "Qiq",
            "author": null,
            "created": "2021-10-20 16:48:23 UTC",
            "updated": [
                "2021-10-20 16:48:23 UTC"
            ],
            "markup": "markdown"
        }
    ],
    "created": "2021-10-20 16:48:23 UTC",
    "updated": [
        "2021-10-20 16:48:23 UTC",
        "2021-10-20 17:03:35 UTC",
        "2021-10-20 17:03:50 UTC"
    ],
    "markup": "markdown",
    "html": "<p>I'm happy to announce the first release of <a href=\"http://qiqphp.com\">Qiq</a>, a template system for developers who prefer native PHP templates -- but with a light dusting of syntax sugar when you want it. It offers <a href=\"http://qiqphp.com/1.x/partials.html\">partials</a>, <a href=\"http://qiqphp.com/1.x/layouts.html\">layouts</a>, <a href=\"http://qiqphp.com/1.x/sections.html\">sections</a>, and a wide range of HTML helpers for <a href=\"http://qiqphp.com/1.x/helpers/general.html\">tags</a> and <a href=\"http://qiqphp.com/1.x/helpers/forms.html\">forms</a>, along with explicit but concise <a href=\"http://qiqphp.com/1.x/syntax.html#1-2-1\">escaping</a>.</p>\n<p>I don't like compiled templates or specialized template languages. Smarty, Twig, etc., are all just too heavy-handed. I don't need a new language, and I don't need to \"secure\" my templates against designers on my team. I am generally happy with plain PHP as a template language.</p>\n<p>However, I do find escaping tedious -- necessary, and easy enough, but tedious. A template helper to output escaped HTML, like this ...</p>\n<pre><code>&lt;?= $this-&gt;h($var) ?&gt;\n</code></pre>\n<p>... is not that bad -- but even so, it could be a <em>little</em> easier. Imagine this little bit of syntax sugar:</p>\n<pre><code>{{h $var }}\n</code></pre>\n<p>All that happens is that <code>{{h ... }}</code> is replaced with <code>&lt;?= $this-&gt;h(...) ?&gt;</code>.</p>\n<p>Once that is in place, it becomes easy to support helpers, control structures, and other code, all while keeping native PHP as the fallback syntax, because the <code>{{ ... }}</code> tags are essentially stand-ins for PHP tags.</p>\n<p>Qiq is PHP -- just with some syntax sugar. <a href=\"http://qiqphp.com\">Try it out</a> on your next project!</p>\n"
}
