1. Go to this page and download the library: Download mvc5/facade 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/ */
mvc5 / facade example snippets
use Arc5\App;
use Arc5\Request;
use Arc5\Response;
use Arc5\Route;
use Arc5\Service;
use Arc5\View;
use Mvc5\Http\Request as HttpRequest;
use Mvc5\Http\Response as HttpResponse;
use Mvc5\View\ViewModel;
use Mvc5\View\ViewLayout;
use const Mvc5\{ BODY, CONTROLLER, REQUEST, RESPONSE, USER };
Service::context(equest[CONTROLLER];
$request = $request->with(USER, Service::plugin(USER));
$controller && $result = Service::call(
$controller, [REQUEST => $request, RESPONSE => $response]
);
}
if ($result instanceof ViewModel) {
!$result instanceof ViewLayout && ($layout = View::layout())
&& $result = $layout->withModel($result);
$result = View::render($result);
}
($result instanceof HttpResponse && $response = $result)
|| $response = $response->with(BODY, $result);
$response = Response::status($request, $response);
$response = Response::version($request, $response);
Response::send($response);
} catch(\Throwable $exception) {
App::exception($exception);
}