{"id":25590710,"url":"https://github.com/cable8mm/stub-template","last_synced_at":"2026-02-13T10:15:12.936Z","repository":{"id":276942281,"uuid":"929886516","full_name":"cable8mm/stub-template","owner":"cable8mm","description":"The package is not a template engine, but you can use it like one to create stub files when needed.","archived":false,"fork":false,"pushed_at":"2025-02-11T13:58:15.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T16:03:51.980Z","etag":null,"topics":[],"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/cable8mm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T16:25:54.000Z","updated_at":"2025-02-11T13:58:18.000Z","dependencies_parsed_at":"2025-02-11T09:49:00.031Z","dependency_job_id":"b1eebca2-5dc8-4614-b2c9-bcc0417f2a9f","html_url":"https://github.com/cable8mm/stub-template","commit_stats":null,"previous_names":["cable8mm/stub-template"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cable8mm/stub-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fstub-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fstub-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fstub-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fstub-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cable8mm","download_url":"https://codeload.github.com/cable8mm/stub-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fstub-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266067295,"owners_count":23871328,"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-02-21T09:30:31.652Z","updated_at":"2026-02-13T10:15:07.884Z","avatar_url":"https://github.com/cable8mm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stub Template\n\n![Coding Style Actions](https://github.com/cable8mm/stub-template/actions/workflows/code-style.yml/badge.svg)\n![Run Tests Actions](https://github.com/cable8mm/stub-template/actions/workflows/run-tests.yml/badge.svg)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/cable8mm/stub-template.svg)](https://packagist.org/packages/cable8mm/stub-template)\n[![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/cable8mm/stub-template/php?logo=PHP\u0026logoColor=white\u0026color=777BB4)](https://packagist.org/packages/cable8mm/stub-template)\n[![Total Downloads](https://img.shields.io/packagist/dt/cable8mm/stub-template.svg)](https://packagist.org/packages/cable8mm/stub-template)\n[![Packagist Stars](https://img.shields.io/packagist/stars/cable8mm/stub-template)](https://github.com/cable8mm/stub-template/stargazers)\n\nThe package is not a template engine, but you can use it like one to create stub files when needed.\n\nIt needs to be used with [Twig template syntax](https://twig.symfony.com/doc/3.x/templates.html).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require cable8mm/stub-template\n```\n\n## Usage\n\n```php\n$stub = Stub::of(__DIR__.'/stubs/sample.stub',\n  [\n    'title' =\u003e 'Home Page',\n    'colors' =\u003e ['red', 'blue', 'green'],\n  ]\n)-\u003erender()\n```\n\nor\n\n```php\n$stub = Stub::of('stubs/sample.stub',\n  [\n    'title' =\u003e 'Home Page',\n    'colors' =\u003e ['red', 'blue', 'green'],\n  ],\n  __DIR__\n)-\u003erender()\n```\n\nstubs/sample.stub :\n\n```twig filename=\"stubs/sample.stub\"\n{{ title }} - \u003c?php echo date('Y-m-d') ?\u003e\n\n\u003ch1\u003eHome\u003c/h1\u003e\n\u003cp\u003eWelcome to the home page, list of colors:\u003c/p\u003e\n\u003cul\u003e\n{% for color in colors %}\n    \u003cli\u003e{{ color }}\u003c/li\u003e\n{% endfor %}\n\u003c/ul\u003e\n\n```\n\nThen,\n\n```html\nHome Page - \u003c?php echo date('Y-m-d') ?\u003e\n\n\u003ch1\u003eHome\u003c/h1\u003e\n\u003cp\u003eWelcome to the home page, list of colors:\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003ered\u003c/li\u003e\n    \u003cli\u003eblue\u003c/li\u003e\n    \u003cli\u003egreen\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nIt make sure that php codes have **NOT** been executed.\n\n### Testing\n\n```bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email \u003ccable8mm@gmail.com\u003e instead of using the issue tracker.\n\n## Credits\n\n- [Samgu Lee](https://github.com/cable8mm)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## PHP Package Boilerplate\n\nThis package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com) by [Beyond Code](http://beyondco.de/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcable8mm%2Fstub-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcable8mm%2Fstub-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcable8mm%2Fstub-template/lists"}