just another foolish blog

10.9.11

CodeIgniter 2.0.3 + RedBean php 2.0

12:31 PM Posted by Eren Yağdıran , , , , , No comments

Hello , I recently wanted to use RedBean Orm framework for a web startup project. So it's better to use it with CodeIgniter i guess.Actually the integration part is simpler than you think.





Download RedBean php , copy “rb.php” to “application/third_party/rb”



Create “application/libraries/rb.php”, and put this inside:



Load the library like any other
$this->load->library('rb');




Do fun stuff with the beans in your controller:
$album = R::dispense('album');

$album->title = '13 Songs';

$album->artist = 'Tarkan';

$album->year = 1990;

$album->rating = 5;

$id = R::store($album);