Skip to content

franmomu/silex-paris-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

ParisServiceProvider

Provider for integrate Idiorm and Paris with Silex

Registering

$app->register(new FranMoreno\Silex\Provider\ParisServiceProvider());

Parameters

$app['idiorm.config'] = array(
    'connection_string' => 'mysql:host=localhost;dbname=my_database',
    'username' => 'database_user',
    'password' => 'top_secret'
);

$app['paris.model.prefix'] = '\\My\\Model\\';

Use in controllers

$app->get('/index', function (Request $request) use ($app) {

    $userFactory = $app['paris']->getModel('User');
    $results = $userFactory->find_many();

    return $app['twig']->render('index.html', array(
        'results' => $results
    ));
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages