{"id":27158869,"url":"https://github.com/activecollab/templateengine","last_synced_at":"2026-02-17T00:05:28.993Z","repository":{"id":56940251,"uuid":"59407749","full_name":"activecollab/templateengine","owner":"activecollab","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-23T14:18:37.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T13:03:29.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/activecollab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-22T10:59:47.000Z","updated_at":"2024-02-06T15:11:38.000Z","dependencies_parsed_at":"2022-08-21T06:50:55.535Z","dependency_job_id":null,"html_url":"https://github.com/activecollab/templateengine","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Ftemplateengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Ftemplateengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Ftemplateengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Ftemplateengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activecollab","download_url":"https://codeload.github.com/activecollab/templateengine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941718,"owners_count":21022035,"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":[],"created_at":"2025-04-08T22:39:14.981Z","updated_at":"2026-02-17T00:05:28.946Z","avatar_url":"https://github.com/activecollab.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Template Engine\n\n[![Build Status](https://travis-ci.org/activecollab/templateengine.svg?branch=master)](https://travis-ci.org/activecollab/templateengine)\n\nThis package offers a single interface for interaction with multiple template engines. It ships with simple PHP template engine built in:\n\n```php\n$template_engine = new PhpTemplateEngine('/path/to/templates/dir');\n\n// Set attributes that will be passed to all templates. Method chaining is supported.\n$template_engine-\u003esetAttributes([\n    'app_name' =\u003e 'My Awesome App',\n    'app_version' =\u003e '1.0.0',\n])-\u003eaddAttribute('app_env', 'staging');\n\n// Render template to output buffer\n$template_engine-\u003edisplay('/mail/hello.php', ['first_name' =\u003e 'John'])\n\n// Render template and return output as a string\n$output = $template_engine-\u003efetch('/mail/hello.php', ['first_name' =\u003e 'John'])\n```\n\n## Template Sandboxing\n\nTemplates are sandboxed, and can be placed only in templates directory that is specified when engine is constructed. If you try to use a template that is not in this directory, template engine will throw a `\\RuntimeException`:\n\n```php\n$template_engine-\u003efetch('/example/../../../../etc/passwd'); // Will throw an exception\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Ftemplateengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecollab%2Ftemplateengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Ftemplateengine/lists"}