1. Go to this page and download the library: Download ashleydawson/multibundle 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/ */
ashleydawson / multibundle example snippets
namespace Acme\MyBundle;
use AshleyDawson\MultiBundle\AbstractMultiBundle;
class AcmeMyBundle extends AbstractMultiBundle
{
/**
* Optional: define a protected constructor to stop instantiation outside of registerInto()
*/
protected function __construct()
{
}
/**
* Define bundles that this bundle depends on
*/
protected static function getBundles()
{
return array(
new Acme\FooBundle\AcmeFooBundle(),
new Acme\BarBundle\AcmeBarBundle(),
);
}
}
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
$bundles = array(
// ...,
new FOS\UserBundle\FOSUserBundle(),
);
// Register my bundle and its dependencies
\Acme\MyBundle\AcmeMyBundle::registerInto($bundles);
// ...
}
}
namespace Acme\MyBundle;
use AshleyDawson\MultiBundle\AbstractMultiBundle;
class AcmeMyBundle extends AbstractMultiBundle
{
/**
* Optional: define a protected constructor to stop instantiation outside of registerInto()
*/
protected function __construct()
{
}
/**
* Define bundles that this bundle depends on
*/
protected static function getBundles()
{
return array(
'prod' => array(
new Acme\FooBundle\AcmeFooBundle(),
new Acme\BarBundle\AcmeBarBundle(),
),
'dev' => array(
new Acme\BazBundle\AcmeBazBundle(),
),
);
}
}
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
$bundles = array(
// ...,
new FOS\UserBundle\FOSUserBundle(),
);
// Register my bundle and its dependencies for the 'prod' environment
\Acme\MyBundle\AcmeMyBundle::registerInto($bundles, 'prod');
if ('dev' == $this->getEnvironment()) {
// Register my bundle and its dependencies for the 'dev' environment
\Acme\MyBundle\AcmeMyBundle::registerInto($bundles, 'dev');
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.