CodeIgniter 3.x with RedBean PHP ORM |
So im gonna share this stuff to you guys, this is about how to use readbean php ORM to your codeigniter
1. First download the latest version here ReadBeanPHP Latest 2.Extract the contents and copy the rb.php to your application/third_party folder 3. In your controller, require the file rb.php Code: <?php 4. And in your controller constructor add this code PHP Code: public function __construct(){ Now you can use the readbean ORM by calling it's static Class To get all records from database simply do this Example Code: If you want to get all records from your table just simply call the R::findAll static method In your controller Code: public function list_records(){ Note: every tables must have a column named "id" and has a primary key and auto increment.refer to the screenshot below To know more about RedBean PHP ORM just follow this links CRUD BASICS http://www.redbeanphp.com/crud FINDING http://www.redbeanphp.com/finding or visit their official site for more docs http://www.redbeanphp.com/ Download Sample Code here
Just a random guy from Internet
|
Welcome Guest, Not a member yet? Register Sign In |