{"id":15525376,"url":"https://github.com/ghostwriter/phtml","last_synced_at":"2025-07-31T09:39:46.367Z","repository":{"id":249911714,"uuid":"832899213","full_name":"ghostwriter/phtml","owner":"ghostwriter","description":"[WIP]A powerful PHP template engine designed to deliver high-performance, extensibility, and security.","archived":false,"fork":false,"pushed_at":"2025-07-27T22:27:23.000Z","size":515,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"0.1.x","last_synced_at":"2025-07-28T00:22:00.849Z","etag":null,"topics":["ghostwriter","php","phtml","template-engine"],"latest_commit_sha":null,"homepage":"https://github.com/ghostwriter/phtml","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostwriter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["ghostwriter"]}},"created_at":"2024-07-24T00:41:42.000Z","updated_at":"2025-07-27T22:27:25.000Z","dependencies_parsed_at":"2025-01-08T02:26:44.938Z","dependency_job_id":"45318ec1-0c12-41ac-8942-d5112e359454","html_url":"https://github.com/ghostwriter/phtml","commit_stats":null,"previous_names":["ghostwriter/phtml"],"tags_count":0,"template":false,"template_full_name":"ghostwriter/template","purl":"pkg:github/ghostwriter/phtml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostwriter","download_url":"https://codeload.github.com/ghostwriter/phtml/tar.gz/refs/heads/0.1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fphtml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268017357,"owners_count":24181669,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ghostwriter","php","phtml","template-engine"],"created_at":"2024-10-02T10:57:09.178Z","updated_at":"2025-07-31T09:39:46.340Z","avatar_url":"https://github.com/ghostwriter.png","language":"PHP","funding_links":["https://github.com/sponsors/ghostwriter"],"categories":[],"sub_categories":[],"readme":"# Phtml\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/ghostwriter?label=Sponsor+@ghostwriter/phtml\u0026logo=GitHub+Sponsors)](https://github.com/sponsors/ghostwriter)\n[![Automation](https://github.com/ghostwriter/phtml/actions/workflows/automation.yml/badge.svg)](https://github.com/ghostwriter/phtml/actions/workflows/automation.yml)\n[![Supported PHP Version](https://badgen.net/packagist/php/ghostwriter/phtml?color=8892bf)](https://www.php.net/supported-versions)\n[![Downloads](https://badgen.net/packagist/dt/ghostwriter/phtml?color=blue)](https://packagist.org/packages/ghostwriter/phtml)\n\nA powerful PHP template engine designed to deliver high-performance, extensibility, and security.\n\n\u003e [!WARNING]\n\u003e\n\u003e This project is not finished yet, work in progress.\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require ghostwriter/phtml\n```\n\n### Star ⭐️ this repo if you find it useful\n\nYou can also star (🌟) this repo to find it easier later.\n\n## Usage\n\n```php\nuse Ghostwriter\\Phtml\\Phtml;\n\n$phtml = Phtml::new('path/to/templates', 'path/to/cache');\n\n$phtml-\u003eregisterNamespace('html', 'path/to/templates/html');\n\n// File: path/to/templates/html/element/paragraph.phtml\n// Content: \u003cp\u003e{{ $message }}\u003c/p\u003e\n\n// \"html\" is the namespace.\n// \"element\" is the directory name inside the namespace.\n// \"paragraph\" is the template filename inside the directory, without the \".phtml\" extension.\n\n$html = $phtml-\u003erender('html::element.paragraph',['message' =\u003e '#BlackLivesMatter']);\n\necho $html; // \u003cp\u003e#BlackLivesMatter\u003c/p\u003e\n```\n\n### Advanced Usage\n```php\nuse Ghostwriter\\Phtml\\Cache\\PhtmlCache;\nuse Ghostwriter\\Phtml\\Compiler\\PhtmlCompiler;\nuse Ghostwriter\\Phtml\\Engine\\PhtmlEngine;\nuse Ghostwriter\\Phtml\\Loader\\PhtmlLoader;\nuse Ghostwriter\\Phtml\\Renderer\\PhtmlRenderer;\n\n$cache = PhtmlCache::new('path/to/cache');\n$loader = PhtmlLoader::new('path/to/templates');\n$compiler = PhtmlCompiler::new($cache, $loader);\n$engine = PhtmlEngine::new($compiler);\n$renderer = PhtmlRenderer::new($engine);\n\n$result = $renderer-\u003erender(template: 'alert', context: ['message' =\u003e '#BlackLivesMatter']);\n```\n\n### Credits\n\n- [Nathanael Esayeas](https://github.com/ghostwriter)\n- [All Contributors](https://github.com/ghostwriter/phtml/contributors)\n\n### Changelog\n\nPlease see [CHANGELOG.md](./CHANGELOG.md) for more information on what has changed recently.\n\n### License\n\nPlease see [LICENSE](./LICENSE) for more information on the license that applies to this project.\n\n### Security\n\nPlease see [SECURITY.md](./SECURITY.md) for more information on security disclosure process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fphtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostwriter%2Fphtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fphtml/lists"}