{"id":25518289,"url":"https://github.com/cherry-framework/templater","last_synced_at":"2026-04-17T01:02:03.227Z","repository":{"id":62501558,"uuid":"178280063","full_name":"cherry-framework/templater","owner":"cherry-framework","description":"The Cherry-project Template wrapper","archived":false,"fork":false,"pushed_at":"2019-05-11T19:01:37.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T16:55:07.625Z","etag":null,"topics":["cherry","composer","templater"],"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/cherry-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-03-28T20:48:44.000Z","updated_at":"2019-05-11T19:01:39.000Z","dependencies_parsed_at":"2022-11-02T12:15:20.761Z","dependency_job_id":null,"html_url":"https://github.com/cherry-framework/templater","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cherry-framework/templater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherry-framework%2Ftemplater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherry-framework%2Ftemplater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherry-framework%2Ftemplater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherry-framework%2Ftemplater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cherry-framework","download_url":"https://codeload.github.com/cherry-framework/templater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherry-framework%2Ftemplater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31910585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cherry","composer","templater"],"created_at":"2025-02-19T16:25:03.503Z","updated_at":"2026-04-17T01:02:03.137Z","avatar_url":"https://github.com/cherry-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cherry-Templater\nThe Cherry-project Template wrapper\n\n[![GitHub license](https://img.shields.io/github/license/abgeo07/cherry-templater.svg)](https://github.com/ABGEO07/cherry-templater/blob/master/LICENSE)\n\n[![GitHub release](https://img.shields.io/github/release/abgeo07/cherry-templater.svg)](https://github.com/ABGEO07/cherry-templater/releases)\n\n[![Packagist Version](https://img.shields.io/packagist/v/cherry-project/templater.svg \"Packagist Version\")](https://packagist.org/packages/cherry-project/templater \"Packagist Version\")\n\n------------\n\n## Including\n**Install from composer** `composer require cherry-project/templater`\n\n**Include Autoloader in your main file** (Ex.: index.php)\n```php\nrequire_once __DIR__ . '/vendor/autoload.php';\n```\n\n## Class Templater\nImport class\n```php\nuse Cherry\\Templating\\Templater;\n```\nCrete class new object\n```php\n$templateEngine = new Templater(PATH_TO_TEMPLATES);\n```\n\nWhere `PATH_TO_TEMPLATES` is path to your templates folder. Ex.: `__DIR__ . '/../examples/templates'`\n\nCreate new template in you'r templates folder (Ex.: `index.templater.php`) which contains simple HTML \nMarkup with PHP:\n\n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003ctitle\u003eHello, World!\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003ch1\u003eHello, {{ name }}!\u003c/h1\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nThen you can call `$templateEngine` objects `render` method with two arguments:\n\n- Name of rendering template\n- Arguments (PHP Variables) for template\n\nArguments is simple PHP Array:\n\n```php\n$args = [\n    'name' =\u003e 'Name 1',\n    'surname' =\u003e 'Surname 1'\n];\n```\n\nOur `index.templater.php` template contains only one PHP Variable `$name`, so we must pass it in `render` method:\n\n```php\n$response = $templateEngine-\u003erender('index.templater.php', [\n    'name' =\u003e 'Temuri'\n]);\n```\n\nAfter that `$response` Variable will contain Response object and we can print it:\n\n```php\necho $response;\n```\n\nIn first argument of `render` method we can put full filename of template (`index.templater.php`)\nor only template name (name without file extension Ex.: `index`)\n\n**2019 \u0026copy; Cherry-project**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcherry-framework%2Ftemplater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcherry-framework%2Ftemplater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcherry-framework%2Ftemplater/lists"}