PHP code example of web-complete / mvc

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

    

web-complete / mvc example snippets




ed('ENV')
or define('ENV', in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], false) ? 'dev' : 'prod');

$config = ntController::class);
$front->dispatch()->send();



return [
    'aliases' => [
        '@app' => \dirname(__DIR__ . '/../app'),
        '@web' => \dirname(__DIR__ . '/../web'),
    ],
    'routes' => [
        ['GET', '/post/list', [\app\controllers\PostController::class, 'actionList']],
        ['POST', '/post/update', [\app\controllers\PostController::class, 'actionUpdate']],
    ],
    'cubesLocations' => [
        '@app/cubes',
    ],
    'definitions' => [
        'errorController' => \DI\object(\app\controllers\ErrorController::class),
    ]
];



namespace app\controllers;

class SomeController extends AbstractController
{

    protected $layout = '@app/views/layouts/main.php';

    public function index()
    {
        return $this->responseHtml('@app/views/some/index.php', ['name' => 'World']);
    }
}