{"id":24108284,"url":"https://github.com/settermjd/mezzio-static-pages","last_synced_at":"2025-10-28T22:38:26.891Z","repository":{"id":44663794,"uuid":"209241121","full_name":"settermjd/mezzio-static-pages","owner":"settermjd","description":"Render static pages with ease in Mezzio applications","archived":false,"fork":false,"pushed_at":"2025-08-06T01:36:31.000Z","size":454,"stargazers_count":6,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-19T01:59:05.120Z","etag":null,"topics":["html","laminas","mezzio","php73","psr-15"],"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/settermjd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-18T07:04:23.000Z","updated_at":"2025-08-06T01:36:34.000Z","dependencies_parsed_at":"2024-10-12T12:40:35.892Z","dependency_job_id":"f63b3e1c-3ff2-4ceb-b0c5-c6e4ed8bc3f8","html_url":"https://github.com/settermjd/mezzio-static-pages","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":"0.19354838709677424","last_synced_commit":"aed2e57bc862d71d290e4142279fa7d069108958"},"previous_names":["settermjd/mezzio-static-pages","settermjd/laminas-static-pages"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/settermjd/mezzio-static-pages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fmezzio-static-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fmezzio-static-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fmezzio-static-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fmezzio-static-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/settermjd","download_url":"https://codeload.github.com/settermjd/mezzio-static-pages/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fmezzio-static-pages/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281527113,"owners_count":26516844,"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-10-28T02:00:06.022Z","response_time":60,"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":["html","laminas","mezzio","php73","psr-15"],"created_at":"2025-01-10T23:26:58.209Z","updated_at":"2025-10-28T22:38:26.845Z","avatar_url":"https://github.com/settermjd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laminas Static Pages Module\n\n![testing workflow](https://github.com/settermjd/laminas-static-pages/actions/workflows/continuous-integration.yml/badge.svg)\n\nAn, almost, painless way to render static pages in [Mezzio](https://docs.mezzio.dev/mezzio/) applications.\n\n**Note:** This module **does not** support laminas-mvc applications.\n\nThe intent of this package is to avoid the necessity to create handlers and handler factories just to render static content.\nIt was motivated by various projects that I've worked on, where that seemed to be the case, at least at the time.\nThat approach never made sense to me, so that's that motivated me to scratch my own itch.\n\n## Getting Started\n\nTo install the package, run `composer require settermjd/laminas-static-pages`.\n\nIf you want to automate the enabling of the module when running `composer require/install/update`, then your project needs to use [laminas/laminas-component-installer].\nIf it does, when the package is installed you'll be asked if you want to enable its ConfigProvider.\nAnswer with `Y` and the package will be ready to use.\n\nIf you don't use `laminas-component-installer`, or for some reason or other can't, then ensure that `\\StaticPages\\ConfigProvider::class,` is in the `ConfigAggregator` list in `config/config.php`, as in the example below.\n\n```php\n$aggregator = new ConfigAggregator([\n    \\StaticPages\\ConfigProvider::class,\n]);\n```\n\nWith the package installed, you now need to do two further steps:\n\n1. Configure the template path\n2. Create routes\n3. Create template files\n\n### Configure The Template Path\n\nTo configure the template path, ensure that in your template paths list, there's one with the key `static-pages`, as in the example below.\n\n```php\npublic function getTemplates() : array\n{\n    return [\n        'paths' =\u003e [\n            'static-pages' =\u003e [__DIR__ . '/../templates/static-pages'],\n        ],\n    ];\n}\n```\n\n### Create Routes\n\nTo create a route for a static page, in your routing table, add one or more named routes where:\n\n1. The route’s handler is `StaticPagesHandler::class`\n2. The name follows the convention: `static.\u003ctemplate_file_name_minus_file_extension\u003e`.\n\nLet's assume that we are adding a route for a privacy page and that the template file which will be rendered is `privacy.phtml`.\nIn that case we'd add the following to `config/routes.php`:\n\n```php\n$app-\u003eget('/privacy', StaticPagesHandler::class, 'static.privacy');\n```\n\n### Create Template Files\n\nThe file can contain whatever you like, it doesn't matter.\n\n### That’s It\n\nAll being well, this should be all that you need to rapidly serve static content files in your [Mezzio](https://docs.mezzio.dev/mezzio/) applications.\n\n[laminas/laminas-component-installer]: https://github.com/laminas/laminas-component-installer\n\n## Support\n\n- [Issues](https://github.com/settermjd/laminas-static-pages/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Fmezzio-static-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsettermjd%2Fmezzio-static-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Fmezzio-static-pages/lists"}