Download the PHP package filarichard/mvc_micro_framework without Composer
On this page you can find all versions of the php package filarichard/mvc_micro_framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download filarichard/mvc_micro_framework
More information about filarichard/mvc_micro_framework
Files in filarichard/mvc_micro_framework
Package mvc_micro_framework
Short Description Simple MVC Micro Framework
License MIT
Informations about the package mvc_micro_framework
mvc_micro_framework
Simple MVC Micro Framework
mvc_micro_framework is simple and lightweight PHP micro framework, that allows you easy and fast build of MVC applications. It's simple and extensible!
Minimum requires
mvc_micro_framework requires PHP 7.1
or grater.
Installation
- Download
With Composer:
composer require filarichard/mvc_micro_framework
Without Composer:
Download files and extract them directly to web directory.
-
Create App and call run function
- Create config.json file in
/config
directory
Possible config values are:
- routes - list of all routes used in the app, that doesn't use modules.
- modules - list of all modules used in the app.
- router - path to PHP fith configured router.
- diContainer - path to PHP fith configured DI Container.
- request - path to PHP fith configured HTTP Request.
Routing
For fully working routing, use followed directory:
- config
- src
- config
- All configuration files for modules
- modelname.config.json
- controllers
- All controllers
- If defined, use Modul name
- Modul Controllers
- models
- views
For Router setup, you can use on of the following choices:
- Define routes in config file
All routes, that aren't included in modules, create in config.json file.
All routes, that are in modules, create in modulname.config.json files.
Structure of route definition:
- Define own router with all routes
Template Engine
mvc_micro_framework have built-in Template Engine. Just follow these few steps:
-
Set template
-
Assign variables
-
Use those variables in HTML code
- Render View
Function render can take second parameter that define if path is full or relative to /src/views
.
Event Dispatcher
With following steps, you can use our Event Dispatcher:
-
Create new Dispatcher
-
Create new Event
- Attach him to Listener
Note: Listener can be any Callable object.
- Dispatch Event
You can also remove Event
or stop event propagation
Third Parties Components
mvc_micro_framework support following components from third parties:
- HTTP Foundation/Symfony
- Eloquent (ORM)/Laravel
- Pimple (DI Container)
- Monolog (Logger)
License
Flight is released under the MIT license.
All versions of mvc_micro_framework with dependencies
pimple/pimple Version ^3.0
monolog/monolog Version ^1.24
symfony/http-foundation Version ^4.3