Skip to content

Instantly share code, notes, and snippets.

@daniel-zahariev
Created October 13, 2015 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniel-zahariev/80d55c770d12895b2213 to your computer and use it in GitHub Desktop.
Save daniel-zahariev/80d55c770d12895b2213 to your computer and use it in GitHub Desktop.
One page setup for Models mapping to MySQL with Phalcon
<?php
$di = new Phalcon\Di();
$di->set('modelsManager', new Phalcon\Mvc\Model\Manager());
$di->set('modelsMetadata', new Phalcon\Mvc\Model\Metadata\Memory());
$di->set('db', function () {
return new Phalcon\Db\Adapter\Pdo\Mysql(array(
"host" => "host",
"username" => "username",
"password" => 'password',
"dbname" => "dbname"
));
});
class Users extends Phalcon\Mvc\Model {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment