Simple database CRUD for Codeigniter |
[eluser]keevitaja[/eluser]
I wrote a simple database abstraction layer to work with database tables. Simple Crud @ GitHub PHP 5.3 required Simple CRUD is very simple (it really cannot be more simpler) "database abstraction layer" for CodeIgniter, which gives you some additional benefits. Setup To create a new model extend it from Simple_crud instead of CI_Model. Both Simple_crud and your model must be loaded in CI way. Name your models <Table_name>_model. If you do not like "_model" in all model names, just remove preg_replace from __construct() method. If table name is example, then model would look Code: class Example_model extends Simple_crud {} Usage examples Table: example Fields: id, cats, dogs Model: Example_model Code: // Insert a row: Code: // Fetch a row: Code: // Update a row: Code: // Delete a row: Code: // All together: create, retrieve, update and delete. lol In Example_model you can add your own custom methods as it was the regular CodeIgniter model. Please feel free to use it any way you like!
[eluser]elite-board[/eluser]
very cool, was looking for something just like this thanks. |
Welcome Guest, Not a member yet? Register Sign In |