{"id":16890824,"url":"https://github.com/isruslan/php-template","last_synced_at":"2025-04-11T13:10:23.294Z","repository":{"id":10401997,"uuid":"12555509","full_name":"isRuslan/php-template","owner":"isRuslan","description":"Simple PHP template class.","archived":false,"fork":false,"pushed_at":"2018-02-21T08:05:55.000Z","size":5,"stargazers_count":19,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T09:21:40.972Z","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":"jcjohnson/torch-rnn","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isRuslan.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-09-03T05:09:54.000Z","updated_at":"2023-10-26T06:48:54.000Z","dependencies_parsed_at":"2022-07-21T16:02:18.553Z","dependency_job_id":null,"html_url":"https://github.com/isRuslan/php-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isRuslan%2Fphp-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isRuslan%2Fphp-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isRuslan%2Fphp-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isRuslan%2Fphp-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isRuslan","download_url":"https://codeload.github.com/isRuslan/php-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248405014,"owners_count":21097874,"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":"2024-10-13T17:04:35.866Z","updated_at":"2025-04-11T13:10:23.248Z","avatar_url":"https://github.com/isRuslan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-template\n\nSimple PHP template class.\n\n## Create template file\n[Example](https://github.com/isRuslan/php-template/blob/master/tpl.html) \u003cbr\u003e\nTemplate variables:\u003cbr\u003e\n- `{var}` - single variable \u003cbr\u003e\n- `{loop items} {name} {end loop}` - loop for items array \u003cbr\u003e\n- `{%index%}` - index of item in items loop\n\n## Create index.php file\n[Example](https://github.com/isRuslan/php-template/blob/master/index.php) \u003cbr\u003e\n- Include template class:\u003cbr\u003e\n`include 'template.php';`\n- Create an object:\u003cbr\u003e\n`$template = new Template();`\n- Set template variables, single:\u003cbr\u003e\n`$template-\u003eassign( 'my_var', 'test' );`\n- Set template variables, loops:\u003cbr\u003e\n`$template-\u003eassign( 'items', array( array( 'name' =\u003e 'First' ), array( 'name' =\u003e 'Second' ) ) );`\n- Parse template:\u003cbr\u003e\n`$template-\u003eparse( 'tpl.html' );`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisruslan%2Fphp-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisruslan%2Fphp-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisruslan%2Fphp-template/lists"}