// Create a new Registry object $registry = new \Zend\Registry(); // Set some configuration parameters $registry->set('db.host', 'localhost'); $registry->set('db.username', 'root'); $registry->set('db.password', ''); // Retrieve a configuration parameter $host = $registry->get('db.host');
// Create a new Registry object $registry = new \Zend\Registry(); // Create a new database connection $db = new \PDO('mysql:host=localhost;dbname=test', 'root', ''); // Add the database connection to the Registry $registry->set('db', $db); // Retrieve the database connection from the Registry $db = $registry->get('db');
{ "require": { "zendframework/zend-registry": "~2.0" } }