PHPackages                             ariffazmi/light-php-framework - 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. ariffazmi/light-php-framework

ActiveLibrary[Framework](/categories/framework)

ariffazmi/light-php-framework
=============================

Light php MVC

0121PHP

Since Jan 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/AriffAzmi/light-php-framework)[ Packagist](https://packagist.org/packages/ariffazmi/light-php-framework)[ RSS](/packages/ariffazmi-light-php-framework/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PFW Framework
=============

[](#pfw-framework)

Install the Application
-----------------------

[](#install-the-application)

### Composer

[](#composer)

Download from github repository. Run `composer install` on your terminal.

How To Use
==========

[](#how-to-use)

Open file .htaccess in root directory. Then change this value with the folder directory name

```
RewriteEngine On
RewriteBase /replace-your-directory-folder-name
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]

```

Server Environment
------------------

[](#server-environment)

Go to root folder directory for this project, then run this command on your terminal.

php pfw setServerEnv yourserverlocation serverusername serverpassword serverdatabase

Or you can edit this file at Pfw/App/Pfw/Server.php

```
define('SERVERLOCATION', '');
define('SERVERUSERNAME', '');
define('SERVERPASSWORD', '');
define('SERVERDATABASE', '');

```

Routing
-------

[](#routing)

```
require 'vendor/autoload.php';

use App\Pfw\Main as App;

$app = new App([
    'debug' => true
]);

//POST
$app->post('/saveUser', function() use($app){

  echo "User Saved! ";
});

//GET
$app->get('/', function() use($app){

  echo "Hello, im your home page.";
});

//GET WITH PARAMETER
$app->get('/hello/.+', function($name) use($app){

  echo "Hello, $name.";
});

```

Routing With Controller
-----------------------

[](#routing-with-controller)

```
//POST
$app = new \App\Main\Pfw([
  'debug' => true
]);

$app->post('/saveUser', function() use($app){

  $app->controller("UserController@save");
});

//GET
$app->get('/', function() use($app){

  $app->controller("HomeController@index");
});

//GET WITH PARAMETER
$app->get('/hello/.+', function($name) use($app){

  $app->controller("HomeController@greetings",$name);
});

```

Model
-----

[](#model)

```
=======================
Example model for User:
=======================

namespace App\Models;

/**
* @return User data
*/

use \App\Pfw\Model;

Class User extends Model{

	protected $table = 'users';
}

============================
Meanwhile in UserController:
============================

namespace App\Controllers;

use \App\Pfw\Main as App;
use \App\Http\Request as Request;

use \App\Models\User as User;

//For store data
public function store()
{
$user = new User();

$user->fname = "John Doe";
$user->email = "johndoe@gmail.com";
$user->mobile_no = "60123456789";

$save = $user->save();
}

//For update data
public function update()
{
$user = new User();

$user->id = 15;
$user->fname = "John Doe 1";
$user->email = "johndoe1@gmail.com";
$user->mobile_no = "60123456789";

$save = $user->save();
}

//For delete data
public function delete()
{
$user = new User();

$user->id = 15;

$delete = $user->delete();
}

//For request form data
public function reqFormData(){

    $req = new Request();

    echo $req->username;
}

//For finding data based on user id
public function FindByUid(){

    $user = new User();
	echo "";
	//Put your id as parameter to that function
	print_r($user->FindByUid(3));
}

//For finding data based on user id and email
public function FindByUidAndEmail(){

    $user = new User();
	echo "";
	//Put your id as parameter to that function
	print_r($user->FindByUidAndEmail(3,'john.doe@gmail.com'));
}

//For finding data based on user id or email
public function FindByUidOrEmail(){

    $user = new User();
	echo "";
	//Put your id and email as parameter to that function
	print_r($user->FindByUidOrEmail(3,'john.doe@gmail.com'));
}

//For finding data based on user id between specific range
public function FindByUidBetween(){

    $user = new User();
	echo "";
	//Put your range as parameter to that function
	print_r($user->FindByUidBetween(0,10));
}

//For finding data based on user id less than specific range
public function FindByUidLessThan(){

    $user = new User();
	echo "";
	//Put your range as parameter to that function
	print_r($user->FindByUidLessThan(10));
}

//For finding data based on user id less greater than specific range
public function FindByUidGreaterThan(){

    $user = new User();
	echo "";
	//Put your range as parameter to that function
	print_r($user->FindByUidGreaterThan(10));
}

//For finding data based on user status is null
public function FindByStatusIsNull(){

    $user = new User();
	echo "";
	//Put your range as parameter to that function
	print_r($user->FindByStatusIsNull());
}

//For finding data based on username like without %% symbol
public function FindByUsernameLike(){

    $user = new User();
	echo "";
	//Put your name as parameter to that function
	print_r($user->FindByUsernameLike('John Doe'));
}

//For finding data based on username like with %% symbol
public function FindByUsernameContaining(){

    $user = new User();
	echo "";
	//Put your name as parameter to that function
	print_r($user->FindByUsernameContaining('John Doe'));
}

"username" as the example of

```

Generate Controller
-------------------

[](#generate-controller)

The controller folder locate at Pfw/App/Controllers/.

Go to root folder directory for this project, then run this command on your terminal.

`php pfw makeController UserController`

Generate Model
--------------

[](#generate-model)

The model folder locate at Pfw/App/Models/.

Go to root folder directory for this project, then run this command on your terminal.

`php pfw makeModel User`

That's it! Now go build something cool.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8551618dd9e3f543277425723daf91bb6e9771b10d6a31cb09014a272187a7d?d=identicon)[ariffazmi](/maintainers/ariffazmi)

---

Top Contributors

[![AriffAzmi](https://avatars.githubusercontent.com/u/11953470?v=4)](https://github.com/AriffAzmi "AriffAzmi (23 commits)")

### Embed Badge

![Health badge](/badges/ariffazmi-light-php-framework/health.svg)

```
[![Health](https://phpackages.com/badges/ariffazmi-light-php-framework/health.svg)](https://phpackages.com/packages/ariffazmi-light-php-framework)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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