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.

v1.2.53(2y ago)399MITPHPPHP ^7.4|^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-docs.herokuapp.com/)[ RSS](/packages/reyjhon-simple-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (49)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 lightweight web application micro framework.

- Uses Model, View, Controller Pattern
- Simple Routing engine
- Using namespace in classes with autoloading
- Controllers with method filters
- Applying PSR-12 Extended Coding Standard
- Uses Twig Template Engine (optional)
- Models with resource-friendly connectivity
- Evironment Configuration
- Error Handling and Reporting
- Easily manage dependency using composer

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

[](#full-documentation)

Simple PHP dependencies
=======================

[](#simple-php-dependencies)

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

Coding Style Guide
==================

[](#coding-style-guide)

You must follow this standard:  HAPPY CODING :)

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

[](#installation)

Via Composer: (recommended)

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

```

VIEWS
=====

[](#views)

This micro framework uses twig for the template engine. But it is *OPTIONAL*. Yes, you can use the plain html only without using twig.

- views must be located at *app/Views* directory.
- all views must be name with suffix *view* before the file extension. eg: *welcome.**view**.html*, *product.**view**.html*
- view cache can be enable or disable in the application config

When rendering a view: (uses twig)
----------------------------------

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

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

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

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

Please read the twig documentation for more information:

**NOTE:**

- You views must be a valid html file. eg: *welcome.view.html*
- layout files can be be a twig file. eg: *layout.twig*, *master.twig*

When rendering normal view: (plain html)
----------------------------------------

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

Pass a third parameter *normal* to recognize it that you want to render without template engine.

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

**NOTE:**

- You views must be a valid php file. eg: *welcome.view.php*
- normal rendering doesn't support inheretance
- Second parameter is the variables you want to passed. If empty, it must be initialize when rendering normal view.

### restrict controller to authenticated users only

[](#restrict-controller-to-authenticated-users-only)

add the *Action* suffix into your method name.

example: if you have a method index in your controller:

```
   public function index()
```

Make it:

```
public function indexAction()
```

Then add this to 'App/Controllers/Controller.php':

```
use App\Helper\Auth\AuthHelper as auth;
use Simple\Request;
```

And create a new method *before* in *Controller.php* like this:

```
    public function before()
    {
        if(!auth::user()) {
           Request::redirect('/auth/index');
        }
    }
```

The un-authenticated user tries to access your restricted controller will be redirected to login page.

Using auth in views
-------------------

[](#using-auth-in-views)

If the user is authenticated the user variable is not null.:

```
  {% if user is null %}
       Please login
  {% else %}
       Hello {{ user.name }}
  {% endif %}
```

- {{ user.name }} display name of current logged in user.
- {{ user.email }} display email of current logged in user.
- {{ user.id }} display ID of current logged in user.

Validation
==========

[](#validation)

Read documentation at

File Upload (on development)
============================

[](#file-upload-on-development)

Using the file upload object in controller

Example in your store action:

```
public function store(Request $request)
{
   $file = $request->file('profile_photo'); // profile_photo is the field name of the input type="file" element
   $file->upload('folder_name'); // specify the folder where the file is going to store, if upload success it wil return true otherwise false.
}
```

**Available Methods:**

- *getFileName()* returns the original filename of the uploaded file
- *getUploadedFileName()* returns the filename of the file when uploaded.
- *getFileSize()* returns the size of the uploaded file
- *getFileExtension()* returns the extension of the uploaded file
- *getFileType()* returns the file type of the uploaded file
- *upload($path)* upload to specified path

Simply Cryptography
===================

[](#simply-cryptography)

Simply Framework offers encryption library using a KEY. This uses defuse/php-encryption you can read more at

Before using encryption please run this command **ONCE**:

```
php cli key:generate

```

Encryption
----------

[](#encryption)

To encryp a text or string:

```
use Simple\Security\SimplyEncrypt;
```

Then you can use is as:

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

Decryption
----------

[](#decryption)

To decrypt a text or string:

```
use Simple\Security\SimplyDecrypt;
```

Then you can use is as:

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

DUMPING VARIABLES
-----------------

[](#dumping-variables)

in replace of var\_dump, use *dump* instead.

```
dd($var)
```

Documentation will be updated soon...
-------------------------------------

[](#documentation-will-be-updated-soon)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

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 ~32 days

Recently: every ~249 days

Total

47

Last Release

1055d ago

Major Versions

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

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

v1.2.50PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/77922853cfbf13550ce7279c7b4e39f19a20ddcde9c35dda5e926152eff81d5d?d=identicon)[jhayann](/maintainers/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

[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1810.1k4](/packages/wpstarter-framework)

PHPackages © 2026

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