PHPackages                             reyjhon/simple-php - 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. reyjhon/simple-php

ActiveProject[Framework](/categories/framework)

reyjhon/simple-php
==================

The Simple PHP is lightweight web application framework.

v3.2.5(3d ago)3105MITPHPPHP ^8.0

Since Jun 9Pushed 2y ago3 watchersCompare

[ Source](https://github.com/yourjhay/simple-php)[ Packagist](https://packagist.org/packages/reyjhon/simple-php)[ Docs](https://simply.rjhon.net)[ RSS](/packages/reyjhon-simple-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (56)Used By (0)

The Simply PHP Framework
========================

[](#the-simply-php-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/3ecbb644bb6ae613e5f2e7a1b62b0e38677c7eb8add55b2d172181f4618ce7b2/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c797068702f6672616d65776f726b2f762f737461626c65)](https://packagist.org/packages/simplyphp/framework)[![Total Downloads](https://camo.githubusercontent.com/87865641093bfafbf3cca4c1dfcf20124c94e00a5b0e2019adaaa936b2c38bc8/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c797068702f6672616d65776f726b2f646f776e6c6f616473)](https://packagist.org/packages/simplyphp/framework)[![License](https://camo.githubusercontent.com/cf2db503794eec3e021408fe2488c32a027de35d2a3dddb2a0fcb1dbcd729a03/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c797068702f6672616d65776f726b2f6c6963656e7365)](https://packagist.org/packages/simplyphp/framework)[![Monthly Downloads](https://camo.githubusercontent.com/96fba3cfcbe8ff6070c3b1ff0e6644ff29856d12c34ab38ee9d55586ea75261f/68747470733a2f2f706f7365722e707567782e6f72672f73696d706c797068702f6672616d65776f726b2f642f6d6f6e74686c79)](https://packagist.org/packages/simplyphp/framework)

About Simple
------------

[](#about-simple)

The Simple PHP is a lightweight web application micro framework.

- Model, View, Controller Pattern
- Simple Routing engine with regex variables, groups, HTTP method filters
- Auto-wiring controller method arguments (Request, FormRequest, services)
- FormRequest validation with automatic validation before controller execution
- Full-featured validation library (76+ rules, 16+ filters, custom callbacks)
- CLI console with generators (controllers, models, requests, observers, auth)
- Uses Twig Template Engine (optional, plain HTML also supported)
- Resource-friendly database connectivity (PDO)
- Environment Configuration (.env)
- Error handling and logging (Whoops for dev, clean error pages for production)
- Controller action suffix for auth middleware (`before`/`after` hooks)
- Encryption library (defuse/php-encryption)
- Resource routes
- PSR-4 autoloading with namespaces

FULL DOCUMENTATION
------------------

[](#full-documentation)

Installation
============

[](#installation)

Via Composer (recommended):

```
composer create-project reyjhon/simple-php
cd simple-php

```

Quick Start
===========

[](#quick-start)

Basic Route
-----------

[](#basic-route)

```
Router::set('/', ['controller' => 'home', 'action' => 'index']);
```

Controller with Auto-wired Request
----------------------------------

[](#controller-with-auto-wired-request)

```
use Simple\Request;

class HomeController extends Controller
{
    public function index(Request $request)
    {
        $name = $request->get('name');
        return view('home.index', ['name' => $name]);
    }
}
```

FormRequest Validation
----------------------

[](#formrequest-validation)

Generate a form request:

```
php cli make:request StoreProductRequest

```

Use it in a controller:

```
use App\Requests\StoreProductRequest;

class ProductController extends Controller
{
    public function store(StoreProductRequest $request)
    {
        $data = $request->validated();
        Product::create($data);
        return view('product.show', ['product' => $data]);
    }
}
```

VIEWS
=====

[](#views)

This micro framework uses Twig for the template engine. But it is *optional*. You can use plain HTML without Twig.

- Views must be located in *app/Views* directory.
- All views must be named with suffix *view* before the file extension. e.g.: *welcome.**view**.html*, *product.**view**.html*
- View cache can be enabled or disabled in the application config.

When rendering a view (with Twig):
----------------------------------

[](#when-rendering-a-view-with-twig)

```
return view('welcome');
```

When a view is inside a folder, include the *folder* then *view name* separated by a *period*:

```
return view('your_folder.welcome');
```

Please read the Twig documentation for more information:

**NOTE:**

- Views must be a valid HTML file: e.g. *welcome.view.html*
- Layout files can be Twig files: e.g. *layout.twig*, *master.twig*

When rendering a plain HTML view:
---------------------------------

[](#when-rendering-a-plain-html-view)

Pass a third parameter `'normal'` to render without the template engine:

```
return view('welcome', [], 'normal');
```

**NOTE:**

- Views must be valid PHP files: e.g. *welcome.view.php*
- Normal rendering does not support inheritance
- The second parameter holds variables to pass. If empty, it must be initialized.

Validation
==========

[](#validation)

Simply includes a full validation library with 76+ validation rules and 16+ filters.

```
use Simple\Validation\Validator as Validate;

$result = Validate::is_valid($_POST, [
    'name'  => 'required|min_len:3|max_len:255',
    'email' => 'required|valid_email',
    'age'   => 'required|numeric|min_numeric:18',
]);
```

Read the full validation documentation at:

Encryption
==========

[](#encryption)

Simply offers encryption using defuse/php-encryption.

Run this command **once**:

```
php cli key:generate

```

Encrypt
-------

[](#encrypt)

```
use Simple\Security\SimplyEncrypt;

$encrypted = SimplyEncrypt::encrypt('secret text');
```

Decrypt
-------

[](#decrypt)

```
use Simple\Security\SimplyDecrypt;

$decrypted = SimplyDecrypt::decrypt($ciphertext);
```

CLI Commands
============

[](#cli-commands)

CommandDescription`php cli make:controller`Generate a controller`php cli make:model`Generate a model`php cli make:request`Generate a FormRequest class`php cli make:observer`Generate an observer`php cli make:auth`Scaffold authentication`php cli serve`Start PHP development server`php cli key:generate`Generate application key`php cli route:list`List all registered routesRouting
=======

[](#routing)

Basic
-----

[](#basic)

```
Router::set('products', [
    'controller' => 'ProductController',
    'action'     => 'index'
]);
```

With variables
--------------

[](#with-variables)

```
Router::set('products/{id:\d+}', [
    'controller' => 'ProductController',
    'action'     => 'show'
]);
```

Resource routes
---------------

[](#resource-routes)

```
Router::resource('products', 'ProductController');
// Generates: index, create, store, show, edit, update, destroy
```

Route groups
------------

[](#route-groups)

```
Router::group('admin', function () {
    Router::get('users', ['controller' => 'AdminController', 'action' => 'users']);
});
```

Full FQCN
---------

[](#full-fqcn)

```
Router::set('admin/{action}', [
    'controller' => 'App\Controllers\Admin\AdminController'
]);
```

Coding Style
============

[](#coding-style)

PSR-12 Extended Coding Standard:

Dependencies
============

[](#dependencies)

- [Twig Template Engine](https://twig.symfony.com)
- [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance55

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~1 days

Total

54

Last Release

3d ago

Major Versions

v1.2.36 → v2.0.0-beta2020-05-18

v1.2.53 → v3.0.02026-06-24

PHP version history (3 changes)v1.2.30PHP &gt;=7.1

v1.2.50PHP ^7.4|^8.0

v3.0.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73352412?v=4)[jhayann](/maintainers/jhayann)[@jhayann](https://github.com/jhayann)

---

Top Contributors

[![yourjhay](https://avatars.githubusercontent.com/u/25504356?v=4)](https://github.com/yourjhay "yourjhay (219 commits)")

---

Tags

frameworkmicro-frameworkphpphp-frameworksframeworksimplysimplephp

### Embed Badge

![Health badge](/badges/reyjhon-simple-php/health.svg)

```
[![Health](https://phpackages.com/badges/reyjhon-simple-php/health.svg)](https://phpackages.com/packages/reyjhon-simple-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.5k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[doppar/framework

The Doppar Framework

4011.2k14](/packages/doppar-framework)[zemit-cms/core

Build Phalcon REST APIs faster with database-first scaffolding, model relationships, eager loading, identity, permissions, CLI, and WebSocket support.

138.5k1](/packages/zemit-cms-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
