{"id":17275127,"url":"https://github.com/daun/templateenginelatte","last_synced_at":"2025-10-29T14:03:36.614Z","repository":{"id":55754596,"uuid":"308988747","full_name":"daun/TemplateEngineLatte","owner":"daun","description":"A ProcessWire module adding Latte to the TemplateEngineFactory.","archived":false,"fork":false,"pushed_at":"2023-11-22T16:51:42.000Z","size":73,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T09:11:41.334Z","etag":null,"topics":["latte","processwire","processwire-modules","template-engine"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-31T23:17:24.000Z","updated_at":"2023-10-19T14:21:07.000Z","dependencies_parsed_at":"2023-11-22T17:38:52.147Z","dependency_job_id":null,"html_url":"https://github.com/daun/TemplateEngineLatte","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"d475bd4318ab3f43898695902634053331f28dd6"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2FTemplateEngineLatte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2FTemplateEngineLatte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2FTemplateEngineLatte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2FTemplateEngineLatte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daun","download_url":"https://codeload.github.com/daun/TemplateEngineLatte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852181,"owners_count":21171842,"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":["latte","processwire","processwire-modules","template-engine"],"created_at":"2024-10-15T08:55:29.258Z","updated_at":"2025-10-29T14:03:36.588Z","avatar_url":"https://github.com/daun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TemplateEngineLatte\n\n[![Build Status](https://travis-ci.org/daun/TemplateEngineLatte.svg?branch=master)](https://travis-ci.org/daun/TemplateEngineLatte)\n[![StyleCI](https://github.styleci.io/repos/308988747/shield?branch=master)](https://github.styleci.io/repos/308988747)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![ProcessWire 3](https://img.shields.io/badge/ProcessWire-3.x-orange.svg)](https://github.com/processwire/processwire)\n\nA ProcessWire module adding [Latte](https://latte.nette.org/) to the [TemplateEngineFactory](https://github.com/wanze/TemplateEngineFactory).\n\nThis module version uses Latte 3, which comes with breaking changes in how tags/macros are\ndefined. If you need to keep using Latte 2, stick with major version `^1.0` of this module. Learn more about\nthe [migration to Latte 3](https://latte.nette.org/en/cookbook/migration-from-latte2) and\n[upgrading macros to tags](https://tomasvotruba.com/blog/how-to-upgrade-latte-2-macro-to-latte-3-tag/).\n\n## Requirements\n\n* ProcessWire `3.0` or newer\n* TemplateEngineFactory `2.0` or newer\n* PHP `8.0` or newer\n* Composer\n\n## Installation\n\nExecute the following command in the root directory of your ProcessWire installation:\n\n```\ncomposer require daun/template-engine-latte:^2.0\n```\n\nThis will install the _TemplateEngineLatte_ and _TemplateEngineFactory_ modules in one step. Afterwards, don't forget\nto enable Latte as engine in the _TemplateEngineFactory_ module's configuration.\n\n\u003e ℹ️ This module includes test dependencies. If you are installing on production with `composer install`, make sure to\npass the `--no-dev` flag to omit autoloading any unnecessary test dependencies!.\n\n## Configuration\n\nThe module offers the following configuration:\n\n* **`Template files suffix`** The suffix of the Latte template files, defaults to `latte`.\n* **`Default layout file`** Layout that all views will extend from unless overwritten.\n* **`Provide ProcessWire API variables in Latte templates`** API variables (`$pages`, `$input`, `$config`...)\nare accessible in Latte,\ne.g. `{$config}` for the config API variable.\n* **`Simplified path resolution`** Enable Blade-style dot syntax for directory traversal. [See below](#simplified-path-resolution).\n* **`Auto refresh templates (recompile)`** Recompile templates whenever the source code changes.\n\n### Simplified Path Resolution\n\nThis option will enable two things:\n\n* Allow dot syntax for directory traversal à la Blade.\n* Prepend the base view directory to all paths, eliminating the need for endless `../` in subdirectories.\n\n#### Example\n\nBoth of these will resolve to `site/templates/views/partials/navigation.latte`:\n\n* Normal resolution: `{include '../../partials/navigation.latte'}`\n* Simplified resolution enabled: `{include 'partials.navigation'}`\n\n## Extending Latte\n\nIt is possible to extend Latte after it has been initialized by the module. Hook the method\n`TemplateEngineLatte::initLatte` to register custom tags, filters, functions etc.\n\nHere is an example how you can use the provided hook to add custom macros and filters.\n\n```php\nwire()-\u003eaddHookAfter('TemplateEngineLatte::initLatte', function (HookEvent $event) {\n    /** @var Latte\\Engine */\n    $latte = $event-\u003earguments('latte');\n\n    // Add filter\n    $latte-\u003eaddFilter('lower', function ($str) { return strtolower($str); });\n\n    // Add custom tags via extensions\n    $latte-\u003eaddExtension(new FooExtension);\n});\n```\n\n\u003e The above hook can be put in your `site/init.php` file. If you prefer to use modules, put it into the module's `init()`\nmethod and make sure that the module is auto loaded.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Ftemplateenginelatte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaun%2Ftemplateenginelatte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Ftemplateenginelatte/lists"}