Skip to content

ivoba/redbean-service-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedBeanServiceProvider

A RedBean ORM ServiceProvider for Silex.

Build Status

Usage

  • Define a db.options array in $app with dsn, user, password and frozen entries.
    Or just pass the array while registering. see below.

  • Register the Service:

                                                                                              'dsn' => 'sqlite:/tmp/db.sqlite'
                                                                                          )));```
    
  • Init RedBean with calling $app['db'];.
    This you can do in your controller or more general.
    Then you can access your configured Facade R.

    use RedBean_Facade as R;
    ...
    $app['db'];
    ...
    $e = R::findAll('table',' ORDER BY date DESC LIMIT 2');
    

Happy tight coupling ;)

About

A RedBean ORM ServiceProvider for Silex.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages