ivoba / redbean-service-provider
A RedBean ORM ServiceProvider for Silex.
3.0.1
2017-02-24 08:51 UTC
Requires
- php: >=5.5.9
- gabordemooij/redbean: ^4.0
- silex/silex: ^2.0
Requires (Dev)
- phpunit/phpunit: ^4.8
README
A RedBean ORM ServiceProvider for Silex.
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 ;)