PHPackages                             myth21/viewcontroller - 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. myth21/viewcontroller

ActiveLibrary[Framework](/categories/framework)

myth21/viewcontroller
=====================

A simple example of a library app to use MVC written in PHP

0142PHP

Since Dec 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/myth21/viewcontroller)[ Packagist](https://packagist.org/packages/myth21/viewcontroller)[ RSS](/packages/myth21-viewcontroller/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Myth21 ViewController.
======================

[](#myth21-viewcontroller)

A simple MVC library written in PHP, jerboa style. Provides a minimal framework to define controllers and actions to run. Includes helper classes such as View for templating and PdoRecord for database record handling.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- PDO PHP extension enabled

Expected Project Structure Default (can be overridden)
------------------------------------------------------

[](#expected-project-structure-default-can-be-overridden)

This library expects the following directory and namespace layout based on your viewcontroller.php configuration:

```
project-root/
│
├── app/
│   ├── controller/               ← Web controllers (e.g., IndexController)
│   │   └── IndexController.php
│   │
│   └── api/                      ← API services and exception controllers
│       ├── SomeApiService.php
│       └── ExceptionController.php
│
├── admin/
│   └── console/                  ← CLI (console) controllers
│       └── SomeConsoleCommand.php
│
├── config/
│   ├── viewcontroller.php        ← Configuration for the library
│   ├── routes.php                ← Optional routing rules
│   └── local_app.php             ← Local environment overrides
│
├── public/                       ← Public web root (optional)
│   └── index.php                 ← Entry point for HTTP requests
│
├── storage/
│   └── .error_log                ← Error logs written by the library
│
├── vendor/                       ← Composer dependencies
│
└── composer.json

```

Installation
------------

[](#installation)

via composer

```
composer require myth21/viewcontroller

```

Or download project and use how you want.

App constructor is waiting for array of params specified in AppParamInterface
-----------------------------------------------------------------------------

[](#app-constructor-is-waiting-for-array-of-params-specified-in-appparaminterface)

```
