Matoo125 / m4mvc

light PHP MVC framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

M4 Framework MVC

GitHub issues Packagist Version

This project is in active development. Feel free to contribute or ask me if you have question.

Read the documentation

To install it you can do:

composer require m4/m4mvc

Or dev version

composer require m4/m4mvc=dev-master

Then:

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

Apps running on M4MVC

About

light PHP MVC framework


Languages

Language:PHP 100.0%