yottacms / framework
Basic framework for Yotta.CMS
v0.1.5
2020-01-16 20:18 UTC
Requires
- php: >=7.2
- symfony/http-kernel: ^4|^5
Requires (Dev)
- phpunit/phpunit: ^7
- symfony/config: ^4|^5
- symfony/dependency-injection: ^4.1.12|^5
README
Installation
composer require yottacms/framework
Usage
Рекурсивная разгрузка зависимых бандлов
// src/Kernel.php in Symfony >= v4 use YottaCms\Framework\Component\HttpKernel\PreloadBundlesKernelTrait; // ... class Kernel extends BaseKernel { use MicroKernelTrait, PreloadBundlesKernelTrait; // remove or rename default "registerBundles" method (it will be replaced by PreloadBundlesKernelTrait) public function registerBundlesDisabled() { $contents = require $this->getProjectDir().'/config/bundles.php'; foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } } } // ... } // YourBundle.php namespace YourBundleNS; use Symfony\Component\HttpKernel\Bundle\Bundle; // ... class YourBundle extends Bundle { public function registerBundles() { return [ \Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle::class => ['all' => true], // @example ]; } }