|
DoctrineComponent
How to integrate Doctrine using DoctrineComponent Installation1 Extract Doctrine(http://www.doctrine-project.org) under application.vendors.doctrine folder 2 Put DoctrineComponent.php under the same folder protected vendors 3 In your config file, preload doctrine component and configure the database string: return array(
'preload'=>array('log', 'doctrine'),
// application components
'components'=>array(
'doctrine'=>array(
'class' => 'application.vendors.doctrine.DoctrineComponent',
'connectionString'=>'mysql://username:password@localhost/dbname',
),
...
DetailsDoctrine will be autoloaded and you can use all the Doctrine functionalities. |
► Sign in to add a comment
You need to patch the init method.
spl_autoload_unregister(array('YiiBase','autoload')); spl_autoload_register(array('Doctrine','autoload')); spl_autoload_register(array('YiiBase','autoload'));http://www.yiiframework.com/doc/cookbook/37/ for Yii version 1.0.6
On YII 1.1.4 (and probably earlier as well), you have to do the following: