Wildfire - Yet another wrapper for Query Builder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: Wildfire - Yet another wrapper for Query Builder (/showthread.php?tid=65336) |
Wildfire - Yet another wrapper for Query Builder - rougin - 05-31-2016 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 { RE: Wildfire - Yet another wrapper for Query Builder - Paradinight - 05-31-2016 I do not see any advantages. Why should i use this? The code is not good. RE: Wildfire - Yet another wrapper for Query Builder - albertleao - 05-31-2016 Hello! What are the advantages of using this over the builtin query builder? RE: Wildfire - Yet another wrapper for Query Builder - rougin - 06-05-2016 Hello @Paradinight and @albertleao, I have now updated the documentation on how to use it and what can it do. Thanks. RE: Wildfire - Yet another wrapper for Query Builder - Paradinight - 06-05-2016 PHP Code: $this->load->model('post'); You code is too complicated. I am using PHP Code: $this->load->model('post_model'); or PHP Code: $this->load->model('post_model'); You addin is too fat. Other crud addins a better. RE: Wildfire - Yet another wrapper for Query Builder - albertleao - 06-09-2016 Hey @rougin, I'm still wondering what benefits there are to using this. I commend your work, but why would I use this over CI's query builder or what I use currently (Eloquent). My current code works as simple as : PHP Code: //User object |