PHP code example of pureisle / micro-mvc

1. Go to this page and download the library: Download pureisle/micro-mvc 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/ */

    

pureisle / micro-mvc example snippets


composer create-project pureisle/micro-mvc {project_name}
php bins/create_module.php {module_name}

http://service.movie.weibo.com:8183/demo/demo/a/index?a=test&b=12 
Controller 文件路径: MODULE_ROOT\Controllers\Demo\A.php
View 文件路径:MODULE_ROOT\Views\Demo\A\index.phtml


$app = new Framework\Models\Application();
$app->execute('exec_function', $argv);
 
 public function _initControllerExceptionHandler(Dispatcher $dispatcher) {
        $dispatcher->registerExceptionHandle('\Framework\Models\ControllerException', function ($exception) {
            ApiDisplay::display(ApiDisplay::PARAM_ERROR_CODE, array($exception->getMessage()));
            return true;
        });
}