forked from braincrafted/bootstrap-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.php
More file actions
79 lines (73 loc) · 2.82 KB
/
Configuration.php
File metadata and controls
79 lines (73 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* This file is part of BraincraftedBootstrapBundle.
*
* (c) 2012-2013 by Florian Eckerstorfer
*/
namespace Braincrafted\Bundle\BootstrapBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Configuration
*
* @package BraincraftedBootstrapBundle
* @subpackage DependencyInjection
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2013 Florian Eckerstorfer
* @license http://opensource.org/licenses/MIT The MIT License
* @link http://bootstrap.braincrafted.com Bootstrap for Symfony2
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
return $this->buildConfigTree();
}
private function buildConfigTree()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('braincrafted_bootstrap');
$rootNode
->children()
->scalarNode('output_dir')->defaultValue('')->end()
->scalarNode('assets_dir')
->defaultValue('%kernel.root_dir%/../vendor/twbs/bootstrap')
->end()
->scalarNode('jquery_path')
->defaultValue('%kernel.root_dir%/../vendor/jquery/jquery/jquery-1.10.2.js')
->end()
->scalarNode('less_filter')
->defaultValue('less')
->validate()
->ifNotInArray(array('less', 'lessphp', 'none'))
->thenInvalid('Invalid less filter "%s"')
->end()
->end()
->arrayNode('customize')
->addDefaultsIfNotSet()
->children()
->scalarNode('variables_file')->end()
->scalarNode('bootstrap_output')
->defaultValue('%kernel.root_dir%/Resources/less/bootstrap.less')
->end()
->scalarNode('bootstrap_template')
->defaultValue('BraincraftedBootstrapBundle:Bootstrap:bootstrap.less.twig')
->end()
->end()
->end()
->arrayNode('auto_configure')
->addDefaultsIfNotSet()
->children()
->booleanNode('assetic')->defaultValue(true)->end()
->booleanNode('twig')->defaultValue(true)->end()
->booleanNode('knp_menu')->defaultValue(true)->end()
->booleanNode('knp_paginator')->defaultValue(true)->end()
->end()
->end()
->end();
return $treeBuilder;
}
}