PHPackages                             mirko-pagliai/simple-view-controller - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mirko-pagliai/simple-view-controller

ActiveLibrary[Framework](/categories/framework)

mirko-pagliai/simple-view-controller
====================================

A lightweight PHP framework focused exclusively on the Controller and View layers

03PHPCI passing

Since Jan 3Pushed 4mo agoCompare

[ Source](https://github.com/mirko-pagliai/simple-view-controller)[ Packagist](https://packagist.org/packages/mirko-pagliai/simple-view-controller)[ RSS](/packages/mirko-pagliai-simple-view-controller/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

simple-view-controller
======================

[](#simple-view-controller)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![CI](https://github.com/mirko-pagliai/simple-view-controller/actions/workflows/ci.yml/badge.svg)](https://github.com/mirko-pagliai/simple-view-controller/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/fc37875192b8836f144890dc6dc0def75b67f2d2dfb8b36aeb24b170f2962f0b/68747470733a2f2f636f6465636f762e696f2f67682f6d69726b6f2d7061676c6961692f73696d706c652d766965772d636f6e74726f6c6c65722f67726170682f62616467652e7376673f746f6b656e3d306d4e4d34714c393875)](https://codecov.io/gh/mirko-pagliai/simple-view-controller)[![CodeFactor](https://camo.githubusercontent.com/0196acdb493985cebb0df2133f0533929517d31a485a540f6060a14c0dbf44a5/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d69726b6f2d7061676c6961692f73696d706c652d766965772d636f6e74726f6c6c65722f6261646765)](https://www.codefactor.io/repository/github/mirko-pagliai/simple-view-controller)

`simple-view-controller` is a lightweight PHP framework focused exclusively on the **Controller** and **View** layers.

It is designed as a library, not as a full-stack framework, and intentionally omits models, ORMs, template engines, and dependency injection containers.

The goal is to provide a minimal, explicit, and predictable runtime for small web applications.

Design goals
------------

[](#design-goals)

- Explicit behavior over implicit conventions
- Minimal and stable public API
- No magic exposed to the user
- Framework as a library, not as an application
- Use Symfony components without adopting a full-stack approach

What the framework provides
---------------------------

[](#what-the-framework-provides)

- An `Application` runtime to handle HTTP requests
- Routing based on [Symfony Routing](https://symfony.com/doc/current/create_framework/routing.html)
- A base `Controller` class
- A minimal `View` abstraction
- Automatic injection of the current `Request` into the `View`
- Automatic template resolution and rendering
- Centralized error handling (404 and 500)
- PSR-3 compatible logging
- Environment variable loading via dotenv

What the framework does NOT provide
-----------------------------------

[](#what-the-framework-does-not-provide)

By design, the framework does not include:

- Models or a data layer
- ORMs or database abstractions
- A dependency injection container
- A templating engine
- HTML helpers
- CLI tooling
- Code generation
- An application entry point (`index.php`)
- A global debug switch

All of these are application-level concerns.

Routing
-------

[](#routing)

Routing is based on [Symfony Routing](https://symfony.com/doc/current/create_framework/routing.html).

Routes can be defined in two supported ways.

### Option 1: defining routes in `config/routes.php` (best way)

[](#option-1-defining-routes-in-configroutesphp-best-way)

By default, the application will try to load routes from `config/routes.php`

The file must return a `RouteCollection`:

```
