PHP code example of mmi / mmi-standard

1. Go to this page and download the library: Download mmi/mmi-standard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mmi / mmi-standard example snippets


namespace MyModule;

use Mmi\Mvc\Controller;

class ArticleController extends Controller
{
    public function indexAction(): void {}
}

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

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

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)