Created
October 13, 2015 08:15
-
-
Save daniel-zahariev/80d55c770d12895b2213 to your computer and use it in GitHub Desktop.
One page setup for Models mapping to MySQL with Phalcon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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