m4/m4mvc

Simple php framework

Installs: 65

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v0.3.0.2 2017-10-13 11:04 UTC

This package is not auto-updated.

Last update: 2025-05-11 07:47:24 UTC


README

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