This chart shows how a browser request moves through the MindVisionCode framework and how a response is built and returned.
Browser Request
|
v
public/index.php
|-- loads autoload.php / vendor autoload
|-- starts the session
|-- creates App + Router
|-- loads routes/web.php
|
v
Request::capture()
|
v
Dispatcher::dispatch()
|
+--> no route matched ----> Response::notFound()
|
+--> route matched -------> Route::dispatch()
|
v
App::call()
|
+--> controller method
| |
| v
| Controller action
| |
| +--> repository / service / view model
| +--> Database::query() / execute()
| +--> view() / json() / redirect()
|
+--> closure route
|
v
direct response data
Dispatcher::normalizeResponse()
|
+--> Response object --------> Response::send()
+--> array ------------------> Response::json() --> Response::send()
+--> string -----------------> Response::send()
Final result:
Browser receives HTML, JSON, or a redirect
Controller -> view() -> View::render() -> template -> layout -> Response
Controller -> json() -> Response::json() -> Response::send()
Controller -> redirect() -> Response::redirect() -> Response::send()
public/index.php bootstraps the appCore\Dispatcher matches routes and handles errorsCore\Route extracts route parametersCore\App invokes controller methods or closuresCore\Controller gives actions helper methodsCore\View renders templates into a layoutCore\Response sends the final outputPowered by TurnKey Linux.