PHP code example of liketomove / yii2-doctrine

1. Go to this page and download the library: Download liketomove/yii2-doctrine library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liketomove / yii2-doctrine example snippets


'components' => [
...
        'doctrine'  => [
             'class'    => 'yii\doctrine\components\DoctrineComponent',
             'isDev'    => true,            //for development 
             'driver'   => 'pdo_mysql',     //database driver
             'user'     => 'user',          //database user
             'password' => 'password',      //password
             'host'     => 'localhost',     
             'dbname'   => 'dbname',        //name database
             'entityPath' => [              //paths with you entity
                 'backend/models',
                 'frontend/models',
                 'console/models',
                 'common/models',
             ]
         ]
]
 

'controllerMap' => [
        ....
        'doctrine' => [
            'class'     => 'yii\doctrine\console\DoctrineController',
        ]
    ]
]