M4 Framework MVC
, (*1)
This project is in active development. Feel free to contribute or ask me if you have question., (*2)
Read the documentation, (*3)
To install it you can do:, (*4)
composer require m4/m4mvc
Or dev version, (*5)
composer require m4/m4mvc=dev-master
Then:, (*6)
<?php
use m4\m4mvc\core\App;
use m4\m4mvc\core\Module;
require_once('vendor/autoload.php');
$app = new App;
$app->settings = [
'namespace' => 'your\\app\\namespace',
'modules' => true // if you want co use modules
];
// register modules
Module::register(['web', 'admin']);
$app->paths = [
'controllers' => 'app/controllers',
'app' => 'app',
'theme' => [
'web' => 'app/theme/web', // path to public theme
'admin' => 'app/theme/admin' // path to admin theme
]
];
// db connection
$app->db([
'DB_HOST' => 'localhost',
'DB_PASSWORD' => '',
'DB_NAME' => 'test',
'DB_USER' => 'root'
]);
// run the app
$app->run();
Or check M4 MVC Example App., (*7)
Apps running on M4MVC