https://github.com/yottacms/framework
Yotta.CMS Framework for Symfony
https://github.com/yottacms/framework
framework symfony yottacms
Last synced: 7 months ago
JSON representation
Yotta.CMS Framework for Symfony
- Host: GitHub
- URL: https://github.com/yottacms/framework
- Owner: yottacms
- Created: 2017-09-13T19:27:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T20:19:37.000Z (about 6 years ago)
- Last Synced: 2025-01-23T13:14:18.890Z (about 1 year ago)
- Topics: framework, symfony, yottacms
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Yotta.CMS Framework Components for Symfony
## Installation
```Bash
composer require yottacms/framework
```
## Usage
Рекурсивная разгрузка зависимых бандлов
```PHP
// 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
];
}
}
```