PHPackages                             shinidev/sapling - 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. shinidev/sapling

ActiveProject[Framework](/categories/framework)

shinidev/sapling
================

A small PHP framework that implements MVC design pattern. This framework is created with the intent to give the author knowledge about php and at the same time be usable for the community.

v1.0.0(5y ago)6112MITPHPPHP &gt;=7.4

Since Jun 28Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ShiniDev/Sapling)[ Packagist](https://packagist.org/packages/shinidev/sapling)[ RSS](/packages/shinidev-sapling/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

**Sapling**
===========

[](#sapling)

 A small PHP framework that implements MVC design pattern. This framework is created with the intent to give the author knowledge about php and at the same time be usable for the community.

**Installation**
================

[](#installation)

```
composer create-project shinidev/sapling directory
```

**Configuration**
=================

[](#configuration)

**.envtemplate**
----------------

[](#envtemplate)

 You can edit the .envtemplate file to correspond to your database configuration, after editing it create a copy and name it .env. It is what Sapling reads for your database configurations. You should not include your .env file when uploading your repository to github.

**config/Debug.php**
--------------------

[](#configdebugphp)

 In here you can enable Sapling's error reporting. Sapling's error reporting is on by default. DEVELOPMENT, when true displays error. STRICT, when true kills the application if there are errors. Note, that this is seperate from php error reporting, if you want to enable php error reporting go to your .env file and set DEVELOPMENT to "TRUE".

**config/Routes.php**
---------------------

[](#configroutesphp)

 In here you can set your base url, default controller, default function and error page directory.

**Usage**
=========

[](#usage)

**src/App/Controller**
----------------------

[](#srcappcontroller)

This is where you're gonna load your models and views.

### **Loading a Model**

[](#loading-a-model)

```
$this->loadModel('modelFile', 'optionalname')
```

### **Using a loaded model**

[](#using-a-loaded-model)

```
$this->ModelFile->function() or $this->OptionalName->function()
```

### **Loading a view**

[](#loading-a-view)

```
$this->loadView('viewFile', 'optionalData')
```

**src/App/Model**
-----------------

[](#srcappmodel)

 This is where you're going to communicate to your database. Model classes is recommended to extend the QueryBuilder class.

### **Example Insert Query**

[](#example-insert-query)

```
    $this->table('tablename'); // sets the table to insert data to
    $this->insert(['columns'], ['datas']); // tells what columns and corresponding data
    // Insert only needs a table name
```

### **Example Select Query**

[](#example-select-query)

```
    $this->table('tablename'); // sets the table to get data from
    $this->whereMany(['columns'], ['values']); // Sets the where clause based on the given columns and values
    // or
    $this->whereSpecific('column', value, '!='); // Appends and sets the specific column and its value one by one.
    // or
    $this->whereManual("WHERE column = ?", [values]); // Set the where clause manually.
    $this->join('left', 'tablename', 'on condition'); // Joins tables
    $this->order('column'); // Order by column
    $this->limit(100); // Limits result
    $this->select(['columns']); // Selects columns
    // Select only needs a table, all the others are optional
```

### **Example Update Query**

[](#example-update-query)

```
    $this->table('tablename'); // sets the table to get data from
    $this->whereMany(['columns'], ['values']); // Sets the where clause based on the given columns and values
    // or
    $this->whereSpecific('column', value, '!='); // Appends and sets the specific column and its value one by one.
    // or
    $this->whereManual("WHERE column = ?", [values]); // Set the where clause manually.
    // It is necessary to have always setted the where clause or else Sapling will display error
    $this->update(['columns'], [values]);
```

### **Example Delete Query**

[](#example-delete-query)

```
    $this->table('tablename'); // sets the table to get data from
    $this->whereMany(['columns'], ['values']); // Sets the where clause based on the given columns and values
    // or
    $this->whereSpecific('column', value, '!='); // Appends and sets the specific column and its value one by one.
    // or
    $this->whereManual("WHERE column = ?", [values]); // Set the where clause manually.
    // It is necessary to have always setted the where clause or else Sapling will display error
    $this->delete();
    // Deletes rows based on the where clause that is setted.
```

### **Getting the builded query**

[](#getting-the-builded-query)

```
    $this->getLastQuery(); // returns a string
```

**Url Helper**
--------------

[](#url-helper)

### **Getting the base url**

[](#getting-the-base-url)

```
Url::baseUrl();
```

### **Redirecting**

[](#redirecting)

```
Url::redirect(url);
```

**Passing parameters to controller**
------------------------------------

[](#passing-parameters-to-controller)

```
  http://localhost/Sapling/controller/method/param1/param2/param3
  // The url above passes 3 parameters to a controller function.
  public function test(param1, param2, param3); // Your controller method
```

**Loading resources**
---------------------

[](#loading-resources)

### **Loading a css file in a view php**

[](#loading-a-css-file-in-a-view-php)

```
href="resources/css/test.css"
```

### **Loading a js file in a view php**

[](#loading-a-js-file-in-a-view-php)

```
''
```

**Notes**
=========

[](#notes)

 Test.php controller and TestModel.php only exists to serve as an example on how to use a controller and a model in Sapling. Database are not needed as long as you don't load a model in your controller.

**Current Features**
====================

[](#current-features)

- Url Routing
- Security against script access
- Secured database credentials
- Simple debugger
- Flexible query builder
- Simple folder structure
- Easy to use and understand
- Documented

**Features to learn/add**
=========================

[](#features-to-learnadd)

- Better routing implementation, similar to of Laravel or Codeigniter
- API implementation

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% 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

Unknown

Total

1

Last Release

1831d ago

### Community

Maintainers

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

---

Top Contributors

[![ShiniDev](https://avatars.githubusercontent.com/u/23019743?v=4)](https://github.com/ShiniDev "ShiniDev (41 commits)")[![MarkCay](https://avatars.githubusercontent.com/u/44314383?v=4)](https://github.com/MarkCay "MarkCay (1 commits)")

---

Tags

learning-projectmvc-frameworkphpphp-frameworksapling-framework

### Embed Badge

![Health badge](/badges/shinidev-sapling/health.svg)

```
[![Health](https://phpackages.com/badges/shinidev-sapling/health.svg)](https://phpackages.com/packages/shinidev-sapling)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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