PHPackages                             php-ci/boilerplate - 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. php-ci/boilerplate

ActiveProject

php-ci/boilerplate
==================

A simple codeigniter boilerplate

343HTML

Since Apr 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/himanshu31shr/ci-boilerplate)[ Packagist](https://packagist.org/packages/php-ci/boilerplate)[ RSS](/packages/php-ci-boilerplate/feed)WikiDiscussions v1 Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

CI Boilerplate
==============

[](#ci-boilerplate)

An advanced boilerplate of codeigniter.

Prerequisities
--------------

[](#prerequisities)

- PHP 7.1+
- PDO extension.
- Composer or composer.phar.
- NPM.

Getting started
---------------

[](#getting-started)

Clone the repo. Install dependencies

```
composer install

```

```
npm install

```

Migrate database

```
php app migrate

```

Voila you are ready to GO!

Features
--------

[](#features)

- Twig templating engine.
- Aauth access control library for user access based on roles and permissions.
- Common Symphony CLI commands for common tasks, such as development server, generating models, controllers etc.
- Eloquent ORM.
- Custom exception handling for managing response based on request type.
- Webpack and laravel mix for concatenation and minification of js and css libraries.
- Classmap autoloading for loading custom classes.
- Global javascript events.

Basics
------

[](#basics)

### Development Server:

[](#development-server)

To start the development server, run following command.

```
php app serve

```

You may also change the default host and port as

```
php app serve

```

### Generating Models

[](#generating-models)

To generate a model, run following command.

```
php app create:model

```

You may defined sub-directories by adding '/' between directories. Please note that the models will be autoloaded using composer classmap autoloading, so you will need to run 'composer dump-autoload' if creating models manually.

By default all the models will be extended to Eloquent ORM base class, if you wish to use CI query builder, extend model to 'CI\_Model' instead of Eloquent in 'MY\_Model' class in core directory.

### Generating Controllers

[](#generating-controllers)

To generate a controller, run following command.

```
php app create:controller

```

Here core class can be 'AdminController', 'GuestController' or 'UserController'.

### Models

[](#models)

Eloquent ORM has been integrated, to use it effective you will be required to create seperate models for each database table. To use a model, load it using following snippet

```
$this->load->model()

```

Once loaded you can access the table as per eloquent syntax, for example:

```
Model::get(id)

```

To learn more about using eloquent, refer the Laravel's Eloquent [user guide](https://laravel.com/docs/5.5/eloquent)

### Exception handling

[](#exception-handling)

To throw an exception use following:

```
show_error($error_heading, $message, $template, $error_code)

```

The exception class sends response according to the request type; such that json will be returned in case of ajax, plain text in cli and html in browser.

### Javascript Events

[](#javascript-events)

To support common crud functions, global events have been added which be readily used for speedy development.

- **Form Event:**

You can use default form submit event on any form by adding *'ajax-submit'* class on the form element. Form validation is also pre-build with the same event. To validate fields, you may use custom data attributes on the form elements. All of the custom attribute follows [ParsleyJS](http://parsleyjs.org/doc/index.html#validators).

Sample form:

```

	...

	...

```

- **Modal Event:**An event for managing 'bootstrap modals' have also been added. To use it you will have to specify 'open-modal' class on the button or any other clickable element, along with 'data-url' attribute.

Sample:

```
Open Modal

```

Handler method is not prebuilt, you may construct it in any manner you require; with the requirement of response being in following format, in json:

```
{
	'status': true,
	'modal':
}

```

Resource Handling:
------------------

[](#resource-handling)

To minify css and js dependencies, use:

```
npm run production

```

Alternatvely when on development or local server, use:

```
npm run dev

```

To add more global dependencies add packages using npm and include resource file in app.scss and app.js.

Built with:
-----------

[](#built-with)

- [codeigniter-ss-twig](https://github.com/kenjis/codeigniter-ss-twig) - Twig wrapper for codeigniter
- [Eloquent](https://github.com/illuminate/database) - ORM ported from laravel
- [Symphony Console](https://github.com/symfony/console) - CLI tools from symphony
- [CodeIgniter-Aauth](https://github.com/magefly/CodeIgniter-Aauth) - ACL library

Authors:
--------

[](#authors)

- **Himanshu Shrivastava** [LinkedIn](https://www.linkedin.com/in/himanshu31shr/) | [Facebook](https://www.facebook.com/himanshu31shr)

See also the list of [contributors](https://github.com/himanshu31shr/ci-boilerplate/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

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/60755d22966f792b0be9ff372fbbbef6ccfb2cc4a8b184c454f6172a74aaf334?d=identicon)[himanshu31shr](/maintainers/himanshu31shr)

---

Top Contributors

[![himanshu31shr](https://avatars.githubusercontent.com/u/8560742?v=4)](https://github.com/himanshu31shr "himanshu31shr (26 commits)")

---

Tags

boilerplatecodeignitercodeigniter3php7

### Embed Badge

![Health badge](/badges/php-ci-boilerplate/health.svg)

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

PHPackages © 2026

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