A ReadbeanPHP plugin for CodeIgniter
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Warning: This plugin contains an old version of redbeanphp.
I currently do not have the time to update it, sorry.


This is a plugin that enables you to use the RedbeanPHP library in your Codeigniter projects. It is espacially usefull for database prototyping.

Redbean is available at: RedBeanPHP.com while CodeIgniter can be downloaded from CodeIgniter.com .


  1. Download this plugin and extract into your CI project (this will put two files into your /system/plugins folder.
  2. Enable the ci_redbean plugin by adding it to your autoloading config (/system/application/config/autoload.php line 66).
  3. Configure your database as you always do in CI.
  4. Create a model that extends the RedbeanModel class.


To use the new functionality, just create new instances of your models in your controller, add properties to them and call their save() method. The creation or alternation of the database tables aswell as the persistence will be completely handled by redbean. You will never have to touch your phpmyadmin again, because your model’s properties will be persisted, even if the models did not have a similar property before.

If you want to use this in production, you may want to freeze your database to prevent further changes and to enhance performance. To do that just add the following line to your database config file:

$db['default']['frozen'] = TRUE;


class Car_model extends RedbeanModel { }

class Welcome extends Controller
  function index()
    //Creates the table
    $car = new Car_model();
    $car->manufacturer = "Opel";
    $car->model = "Admiral";
    //Transparently alters the existing table
    $car->tires = 4;