tinternet.net/core/DependencyInjection/Configuration.php

53 lines
1.9 KiB
PHP
Raw Normal View History

2021-03-20 13:40:38 +01:00
<?php
namespace App\Core\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
2021-03-23 21:53:34 +01:00
$treeBuilder = new TreeBuilder('core');
2021-03-20 13:40:38 +01:00
$treeBuilder->getRootNode()
->children()
->arrayNode('site')
->children()
->scalarNode('name')
->isRequired()
->cannotBeEmpty()
->end()
->scalarNode('logo')
->isRequired()
->cannotBeEmpty()
->end()
2021-03-20 13:40:38 +01:00
->arrayNode('pages')
->prototype('array')
->children()
->scalarNode('name')
->isRequired()
->cannotBeEmpty()
->end()
->arrayNode('templates')
->prototype('array')
->children()
->scalarNode('name')
->cannotBeEmpty()
->end()
->scalarNode('file')
->cannotBeEmpty()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}