{"id":30138476,"url":"https://github.com/pfcode/megumin-framework","last_synced_at":"2025-08-11T01:14:42.134Z","repository":{"id":57038312,"uuid":"64617491","full_name":"pfcode/megumin-framework","owner":"pfcode","description":"Yet another simple MVC PHP framework","archived":false,"fork":false,"pushed_at":"2023-03-02T20:18:53.000Z","size":32,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T16:47:56.981Z","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-31T21:46:35.000Z","updated_at":"2023-03-02T20:14:08.000Z","dependencies_parsed_at":"2022-08-23T23:30:57.863Z","dependency_job_id":null,"html_url":"https://github.com/pfcode/megumin-framework","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pfcode/megumin-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fmegumin-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fmegumin-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fmegumin-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fmegumin-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfcode","download_url":"https://codeload.github.com/pfcode/megumin-framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fmegumin-framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269816932,"owners_count":24479862,"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-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2025-08-11T01:14:33.862Z","updated_at":"2025-08-11T01:14:42.121Z","avatar_url":"https://github.com/pfcode.png","language":"PHP","readme":"# MeguminFramework\nA simple MVC framework written in PHP. Name was inspired by Megumin from _Kono Subarashii Sekai ni Shukufuku wo!_ anime :)\n\n![Name inspired by Megumin from Kono Subarashii Sekai ni Shukufuku wo!](http://i.imgur.com/BJ7WsCp.jpg)\n\n### Overview\nA main purpose of this project is to easily start a new project codebase using set of base classes and tools that are intended to make your work faster and keep the code clean. \n\nDespite of mainstream PHP frameworks, this one provides only the most common components, such as:\n\n* **Dispatcher** - performs routing to the controllers (with friendly URLs support)\n* **ModelFactory** - manipulates Model storage by queries (SQL databases)\n* **Model** - represents some data in project, such as UserModel, PostModel or so..\n* **Controller** - handles data from inputs, manipulates on Models and presents results to user\n* **View** - presents data from isolated variable scope on page\n \nThere are also basic implementations of some classes:\n\n* **MySQLModelFactory** - ModelFactory that handles custom MySQL queries to retreive and manipulate data\n* **ScopeDebugView** - View that displays informations about controller - can be used for debugging\n\n### Installation\nYou only need to add new dependency to your `composer.json` file:\n\n```\n  \"require\": {\n    \"pfcode/megumin-framework\": \"\u003e=1.0.0\"\n  }, \n```\n\n...and update your project (Composer should automatically download latest package):\n\n```\ncomposer update\n```\n\n### Quick Start\nThere's a sample `index.php` in `examples` directory that uses MeguminFramework and performs sample routing. Here is the basic part of it (assuming that sample controllers have been defined and autoloaded)\n```\n\u003c?php\n\n// Use MeguminFramework namespace to gain direct access to its components\nuse pfcode\\MeguminFramework\\Dispatcher;\nuse pfcode\\MeguminFramework\\View;\n\n// Use PSR-4 autoloader generated by composer\nrequire __DIR__ . \"/../vendor/autoload.php\";\n\n// Set global View parameters (page title doesn't have to be honored by chosen View)\nView::setPageTitlePrefix(\"Website Title\");\nView::setPageTitleSeparator(\" : \");\n\n// Specify namespace that your controllers belongs to \nDispatcher::setControllersNamespace(__NAMESPACE__);\n\n// Set controllers that should be called when routing fails\nDispatcher::setFallbackControllers(DashboardController::class, NotFoundController::class);\n\n// Specify routing table for the dispatcher \n// (you can omit this call when you don't want to use friendly URLs)\nDispatcher::setUrlPatterns(array(\n    \"/test/{id}\" =\u003e TestController::class,\n    \"/test\" =\u003e TestController::class,\n    \"/\" =\u003e DashboardController::class\n));\n\n// Perform routing and execute proper controller\nDispatcher::explosion();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcode%2Fmegumin-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfcode%2Fmegumin-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcode%2Fmegumin-framework/lists"}