An MVC code generator for the Codeigniter framework

Combustor is a Codeigniter library that generates a controller, model, or a view template using database tables.

View source code on Github

Combustor is a Codeigniter library that generates controllers, models, and views based from database tables. It uses the Describe library for retrieving the database tables and as the basis for code generation.

Features

Installation

  1. Download the Codeigniter framework here and extract it to the web server.
  2. Configure the application's database connectivity settings in application/config/database.php.
  3. Install Combustor through the Composer package manager:
    $ composer require rougin/combustor --dev
  4. Install the ORM wrappers Wildfire and Doctrine ORM or both:
    $ vendor/bin/combustor install:wildfire
    $ vendor/bin/combustor install:doctrine

Commands

create:layout

Creates a new header and footer file.

Options

Example

$ vendor/bin/combustor create-layout --bootstrap

create:controller

Creates a new HTTP controller.

Arguments

Options

Example

$ vendor/bin/combustor create:controller users --camel --wildfire

create:model

Creates a new model.

Arguments

Options

Example

$ vendor/bin/combustor create:model users --camel --wildfire

create:view

Creates a new view template.

Arguments

Options

Example

$ vendor/bin/combustor create:view users --bootstrap

create:scaffold

Creates a new HTTP controller, model, and view template.

Arguments

Options

Example

$ vendor/bin/combustor create:scaffold users --bootstrap --wildfire

Wilfire's Methods

The following methods below are available if --wildfire is installed:

delete($table, $delimiters = [])

Deletes the specified data from storage.

Arguments

Example

$this->wildfire->delete('users', ['id' => 3]);

find($table, $delimiters = [])

Finds the row from the specified ID or with the list of delimiters from the specified table.

Arguments

Example

$this->wildfire->delete('users', ['id' => 3]);

get_all($table, $delimiters = [])

Returns all rows from the specified table

Arguments

Returned methods

Example

$delimiters = ['keyword' => 'test', 'per_page' = 3];

$result = $this->wildfire->all('users', $delimiters);

var_dump((array) $result->result());

NOTE: This method is also available if --doctrine is installed.

Reminders