{"id":19675804,"url":"https://github.com/progerxp/htmlki","last_synced_at":"2025-04-29T02:30:42.142Z","repository":{"id":7133250,"uuid":"8429482","full_name":"ProgerXP/HTMLki","owner":"ProgerXP","description":"Seamless templating with HTML spirit. PHP 5.6+","archived":false,"fork":false,"pushed_at":"2021-01-27T17:42:23.000Z","size":135,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T12:42:03.140Z","etag":null,"topics":["html","php","template-engine"],"latest_commit_sha":null,"homepage":"http://squizzle.me/php/htmlki","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProgerXP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-26T09:38:52.000Z","updated_at":"2024-03-16T20:52:10.000Z","dependencies_parsed_at":"2022-08-20T06:20:45.040Z","dependency_job_id":null,"html_url":"https://github.com/ProgerXP/HTMLki","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProgerXP%2FHTMLki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProgerXP%2FHTMLki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProgerXP%2FHTMLki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProgerXP%2FHTMLki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProgerXP","download_url":"https://codeload.github.com/ProgerXP/HTMLki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251420887,"owners_count":21586697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","php","template-engine"],"created_at":"2024-11-11T17:25:57.317Z","updated_at":"2025-04-29T02:30:41.602Z","avatar_url":"https://github.com/ProgerXP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTMLki - seamless templating with the HTML spirit\n\n**HTMLki** takes a non-mainstream approach. Unlike inventing yet another PHP or Mustache it imbues old good HTML with new features - loops, variables, localization, custom tags and more without breaking its original clean form.\n\n```\n\u003cul $menu\u003e\n  \u003cli \"$classes\"\u003e\n    \u003cimg $icon src=$icon\u003e\n    \u003ca \"$url\" target=$target\u003e$caption\u003c/a\u003e\n  \u003c/li\u003e\n\u003c/endul\u003e\n```\n\nWhat we see here is:\n\n* A loop: `\u003cul\u003e` is only output if there's at least one item in `$menu`\n* An \"if\": `\u003cimg\u003e` is only output if `$icon` is non-falsy\n* A bunch of attribute magic: `\u003cli \"classes\"\u003e` (`\u003cli class=\"classes\"\u003e`), `\u003ca \"url\"\u003e` (`\u003ca href=\"url\"\u003e`)\n* Anti-XSS: `$caption` is a variable, **escaped by default**\n\nIt has no dependencies and works out of the box in **PHP 5.6 and above**.\n\n[ [Full documentation](http://squizzle.me/php/htmlki) ]\n\n## Usage\n\n**Available for Composer** under `proger/htmlki` at [Packagist](https://packagist.org/packages/proger/htmlki).\n\n**Standalone:**\n\n```PHP\n// Configure your autoloader to load the HTMLki namespace from class/HTMLki/.\n\necho HTMLki\\HTMLki::template(HTMLki\\HTMLki::compile('\u003cradio\u003e'));\n  //=\u003e \u003cinput type=\"radio\"\u003e\n```\n\n## Features\n\nBecause HTMLki is just HTML on steroids, any text editor with HTML/PHP syntax scheme gets highlighting right most of the time.\n\nHTMLki imbues HTML with:\n\n* XSS protection - output is HTML-escaped **by default**\n* [loops and conditions](http://squizzle.me/php/htmlki#loops) - like in the above example: `\u003cul $list\u003e` and `\u003cif $a == 3\u003e`\n* [attribute magic](http://squizzle.me/php/htmlki#attr) - automatic expansion of `\u003cform file\u003e` into `\u003cform enctype=\"multipart/form-data\"\u003e`, `\u003cdiv \"span-6\"\u003e` into `\u003cdiv class=\"span-6\"\u003e` and more\n* [tag magic](http://squizzle.me/php/htmlki#tags)\n  * shortcuts (`\u003cradio\u003e` into `\u003cinput type=\"radio\"\u003e`)\n  * multitags (`\u003cthead/tr\u003e` into `\u003cthead\u003e\u003ctr\u003e`)\n  * singletags (`\u003ctextarea /\u003e` into `\u003ctextarea\u003e\u003c/textarea\u003e`)\n  * and more\n* [language lines](http://squizzle.me/php/htmlki#language) - simply any text wrapped in double quotes: `\u003cb\u003e\"Hello!\"\u003c/b\u003e`\n* [expressions and variables](http://squizzle.me/php/htmlki#brackets) - like `{ date('d.m.y') }`\n* [PHP code](http://squizzle.me/php/htmlki#php) - just as you guess: `\u003c?='string'?\u003e` - short PHP tags expanded automatically so you don't have to care about any particular `php.ini` settings\n* [function-tags](http://squizzle.me/php/htmlki#funcs) - in form of custom tags like `\u003cinclude\u003e`\n* [input checking](http://squizzle.me/php/htmlki#input) - clearly see what the template accepts: `$\u003ecurrentPage@1 int \u003c= $lastPage`\n* most constructs can be escaped, such as `\"\"Not a language.\"`, `{{ not_an_expr }` and `$$notAVar`\n* this list is not complete - refer to the [documentation](http://squizzle.me/php/htmlki#syntax) for all enhancements\n\nThe above doesn't require any additional integration code. However, you can tailor HTMLki into a markup ideal for your particular application by adding handlers for specific tags, attributes, etc.\n\nFor example, HTMLki can automatically expand `src`, `href` and `action` attributes into full URLs, or have tags like `\u003cerrors\u003e` that output the list of errors linked to some input field (textarea, selectbox, etc.).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogerxp%2Fhtmlki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogerxp%2Fhtmlki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogerxp%2Fhtmlki/lists"}