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 {
Hello!
What are the advantages of using this over the builtin query builder?
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Hello @Paradinight and @albertleao,
I have now updated the documentation on how to use it and what can it do. Thanks.
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.
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
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
|
Welcome Guest, Not a member yet? Register Sign In |