mmi/mmi-standard

MMi Framework project - standard edition

Maintainers

Package info

github.com/milejko/mmi-standard

Language:Makefile

Type:project

pkg:composer/mmi/mmi-standard

Statistics

Installs: 83

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.0 2026-05-11 15:30 UTC

README

A skeleton application built on the MMi Framework (v5+).

Requirements

Tool Version
PHP 8.4+
Composer 2.x
Docker (optional) 20+

Quick start

Option A — PHP built-in server

composer install
make up          # starts php -S 127.0.0.1:8080

Open http://127.0.0.1:8080.

Option B — Docker (Apache)

make docker-up   # builds image, runs container, opens bash inside it

The container maps port 8080 → 80 and mounts the project root as a volume, so code changes are reflected immediately without rebuilding.

Environment configuration

Copy .env to .env.local and adjust values. .env.local is git-ignored.

Variable Default Description
APP_DEBUG_ENABLED 1 Enable debug output
APP_VIEW_CDN (empty) CDN prefix for assets
APP_BASE_URL (empty) Base URL override
CACHE_SYSTEM_ENABLED 1 Internal framework cache
CACHE_PUBLIC_ENABLED 1 Public HTTP cache
DB_HOST localhost Database host
DB_USER (empty) Database user
DB_NAME test Database name
DB_PASSWORD (empty) Database password

Project structure

src/
  App/
    AppRouterConfig.php   # Route definitions
    di.app.php            # DI container config
    Resource/
      template/
        layout.tpl        # Global HTML layout
  Sample/
    HelloController.php   # Example controller
    resource/
      template/
        hello/
          index.tpl       # View for HelloController::indexAction
etc/
  apache2/
    sites-enabled/
      000-default.conf    # Apache vhost (used in Docker)
web/                      # Document root (generated by composer install, git-ignored)
var/                      # Cache, logs, sessions (git-ignored)

Adding a module

  1. Create a controller in src/<ModuleName>/ extending Mmi\Mvc\Controller:
namespace MyModule;

use Mmi\Mvc\Controller;

class ArticleController extends Controller
{
    public function indexAction(): void {}
}
  1. Add a template at src/<ModuleName>/resource/template/<controller>/<action>.tpl.

  2. Register a route in AppRouterConfig.php:

$this->setRoute('my-module', 'articles', ['module' => 'my-module'], ['controller' => 'article', 'action' => 'index']);

DI container

src/App/di.app.php returns a PHP-DI array. Override or add services there:

return [
    RouterConfig::class => create(AppRouterConfig::class),
    MyService::class    => create(MyServiceImpl::class),
];

Make targets

Target Description
make up (default) Start PHP built-in server on port 8080
make docker-up Build image, start container, open interactive bash
make docker-down Stop and remove the container