{"id":36976962,"url":"https://github.com/carlbennett/php-mvc","last_synced_at":"2026-01-13T22:45:47.701Z","repository":{"id":62499648,"uuid":"44661049","full_name":"carlbennett/php-mvc","owner":"carlbennett","description":"A PHP micro-framework for use as a frontend and/or backend","archived":false,"fork":false,"pushed_at":"2022-11-13T18:50:06.000Z","size":162,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T19:53:42.160Z","etag":null,"topics":["backend","composer","framework","frontend","mvc","mvc-framework","php","utility"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlbennett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-21T07:54:49.000Z","updated_at":"2022-11-20T13:45:29.000Z","dependencies_parsed_at":"2023-01-21T14:45:19.158Z","dependency_job_id":null,"html_url":"https://github.com/carlbennett/php-mvc","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/carlbennett/php-mvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlbennett%2Fphp-mvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlbennett%2Fphp-mvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlbennett%2Fphp-mvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlbennett%2Fphp-mvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlbennett","download_url":"https://codeload.github.com/carlbennett/php-mvc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlbennett%2Fphp-mvc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: 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":["backend","composer","framework","frontend","mvc","mvc-framework","php","utility"],"created_at":"2026-01-13T22:45:47.022Z","updated_at":"2026-01-13T22:45:47.694Z","avatar_url":"https://github.com/carlbennett.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-mvc\n[![Build Status](https://github.com/carlbennett/php-mvc/workflows/php-mvc/badge.svg)](https://github.com/carlbennett/php-mvc/actions?query=workflow%3Aphp-mvc)\n\n**php-mvc** is a PHP standard library used with [@carlbennett](https://githhub.com/carlbennett)'s projects. The aspirations of this library are for a project website to include it as middleware.\n\n## Installation\nThis library is available via [composer](https://getcomposer.org) from [packagist](https://packagist.org/packages/carlbennett/php-mvc).\n\n```sh\ncomposer require carlbennett/php-mvc\ncomposer install\n```\n\n## Usage\nThe following is an example of including this library in your project. This\nassumes you have already installed the library via composer.\n\n```php\n\u003c?php\n\nnamespace MySuperAwesomeProject;\n\nuse \\CarlBennett\\MVC\\Libraries\\GlobalErrorHandler;\nuse \\CarlBennett\\MVC\\Libraries\\Router;\nuse \\CarlBennett\\MVC\\Libraries\\Template;\nuse \\RuntimeException;\n\n// Can be used to route requests.\n\n$router = new Router(\n    \"\\\\MySuperAwesomeProject\\\\Controllers\\\\\",\n    \"\\\\MySuperAwesomeProject\\\\Views\\\\\"\n);\n$router-\u003eaddRoute( // URLs: /home, /home.htm, /home.html\n    // pattern, model, view\n    '#^/home(?:\\.html?)?$#', 'Home', 'HomeHtml'\n);\n$router-\u003eroute();\n$router-\u003esend();\n\n// Custom template engine powered by pure PHP, utilizes include() and output buffers.\n\n$context = null; // empty context, used to pass state to template\n(new Template($context, 'HelloWorld'))-\u003erender(); // prints ./src/Templates/HelloWorld.phtml to the client.\n\n// A dynamic error handler. Prints JSON if display_errors is ON, a friendly html page if OFF.\n\nGlobalErrorHandler::createOverrides();\nthrow new RuntimeException('test');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlbennett%2Fphp-mvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlbennett%2Fphp-mvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlbennett%2Fphp-mvc/lists"}