PHPackages                             pfcode/megumin-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. pfcode/megumin-framework

ActiveLibrary[Framework](/categories/framework)

pfcode/megumin-framework
========================

 A simple MVC PHP framework

1.4.0(3y ago)4114MITPHPPHP &gt;=5.6.0

Since Jul 31Pushed 3y ago2 watchersCompare

[ Source](https://github.com/pfcode/megumin-framework)[ Packagist](https://packagist.org/packages/pfcode/megumin-framework)[ RSS](/packages/pfcode-megumin-framework/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

MeguminFramework
================

[](#meguminframework)

A simple MVC framework written in PHP. Name was inspired by Megumin from *Kono Subarashii Sekai ni Shukufuku wo!* anime :)

[![Name inspired by Megumin from Kono Subarashii Sekai ni Shukufuku wo!](https://camo.githubusercontent.com/65cba91782edcea9b9e5133d5430bb55d54813c2ad26ab5c3564dd2cc0e880d4/687474703a2f2f692e696d6775722e636f6d2f424a37577343702e6a7067)](https://camo.githubusercontent.com/65cba91782edcea9b9e5133d5430bb55d54813c2ad26ab5c3564dd2cc0e880d4/687474703a2f2f692e696d6775722e636f6d2f424a37577343702e6a7067)

### Overview

[](#overview)

A 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.

Despite of mainstream PHP frameworks, this one provides only the most common components, such as:

- **Dispatcher** - performs routing to the controllers (with friendly URLs support)
- **ModelFactory** - manipulates Model storage by queries (SQL databases)
- **Model** - represents some data in project, such as UserModel, PostModel or so..
- **Controller** - handles data from inputs, manipulates on Models and presents results to user
- **View** - presents data from isolated variable scope on page

There are also basic implementations of some classes:

- **MySQLModelFactory** - ModelFactory that handles custom MySQL queries to retreive and manipulate data
- **ScopeDebugView** - View that displays informations about controller - can be used for debugging

### Installation

[](#installation)

You only need to add new dependency to your `composer.json` file:

```
  "require": {
    "pfcode/megumin-framework": ">=1.0.0"
  },

```

...and update your project (Composer should automatically download latest package):

```
composer update

```

### Quick Start

[](#quick-start)

There'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)

```
