GalaxyMVC

A small PHP MVC framework built from scratch

A front controller, a URL router, a PDO data layer and plain PHP views, small enough to read in one sitting.

How a request flows

Router

Maps /controller/method/params to a public controller action

app/Core/Router.php

Controller

Asks the model for data and picks a view

app/Controllers/

Model

Runs prepared statements through the PDO wrapper

app/Models/

View

Plain PHP templates rendered inside one layout

app/views/

Posts

Loaded from the posts table by Post::all().

Routing

The router checks with reflection that a path names a public action before anything runs.

Prepared statements

Every value is bound with a PDO type taken from its PHP type, never joined into SQL.

Views

Templates are plain PHP, escaped with htmlspecialchars and rendered inside one layout.