Wildfire - Yet another wrapper for Query Builder |
Hello! I've created a library named Wildfire, yet another wrapper for CodeIgniter's Query Builder class. It can generate CI_Model objects that is based from database tables with ease. https://github.com/rougin/wildfire
Installation You can install it via Composer: Code: $ composer require rougin/wildfire NOTE: composer_autoload must be enabled in the application/config/config.php. Basic Usage Tables (in SQLite) Code: CREATE TABLE "user" ( models/User.php PHP Code: class User extends CI_Model {} Code: CREATE TABLE post ( models/Post.php PHP Code: class Post extends CI_Model {} Using Query Builder PHP Code: $this->load->model('post'); Using raw SQL query PHP Code: $this->load->model('post'); Methods $wildfire->find($table, $delimiters = []) PHP Code: // Returns a post with an ID of 1. $wildfire->get($table = '')->as_dropdown($description = 'description') PHP Code: // Returns a list of posts that can be used in form_dropdown(). $wildfire->set_database($this->db) PHP Code: // Sets as the current database $wildfire->set_query() PHP Code: // Sets as the current query Model Conventions PHP Code: class Post extends CI_Model { |
Messages In This Thread |
Wildfire - Yet another wrapper for Query Builder - by rougin - 05-31-2016, 12:00 PM
RE: Wildfire - Yet another wrapper for Query Builder - by Paradinight - 05-31-2016, 12:22 PM
RE: Wildfire - Yet another wrapper for Query Builder - by albertleao - 05-31-2016, 01:10 PM
RE: Wildfire - Yet another wrapper for Query Builder - by rougin - 06-05-2016, 12:20 AM
RE: Wildfire - Yet another wrapper for Query Builder - by Paradinight - 06-05-2016, 04:34 AM
RE: Wildfire - Yet another wrapper for Query Builder - by albertleao - 06-09-2016, 08:38 AM
|