PHP code example of cekurte / doctrinebundle

1. Go to this page and download the library: Download cekurte/doctrinebundle 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/ */

    

cekurte / doctrinebundle example snippets


// app/AppKernel.php

// ...
public function registerBundles()
{
    $bundles = array(
        // ...
        new Cekurte\DoctrineBundle\CekurteDoctrineBundle(),
        // ...
    );

    // ...
    return $bundles;
}



namespace YourNamespace\YourBundleBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class YourController extends Controller
{
    public function indexAction()
    {
        // ...

        // Change the current database connection...
        $this
            ->get('doctrine.dbal.dynamic_connection')
            ->forceSwitch(
                $dbHost,
                $dbName,
                $dbUser,
                $dbPassword,
                $dbOptions
            )
        ;
    }
}