mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-06-04 23:12:14 +02:00
34 lines
914 B
PHP
34 lines
914 B
PHP
<?php
|
|
|
|
namespace Knp\Bundle\MarkdownBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
|
|
|
class Configuration
|
|
{
|
|
/**
|
|
* Generates the configuration tree.
|
|
*
|
|
* @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
|
|
*/
|
|
public function getConfigTree()
|
|
{
|
|
$treeBuilder = new TreeBuilder();
|
|
|
|
$treeBuilder->root('knp_markdown', 'array')
|
|
->addDefaultsIfNotSet()
|
|
->children()
|
|
->arrayNode('parser')
|
|
->addDefaultsIfNotSet()
|
|
->children()
|
|
->scalarNode('service')->cannotBeEmpty()->defaultValue('markdown.parser.max')->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end();
|
|
|
|
return $treeBuilder->buildTree();
|
|
}
|
|
}
|