Created
September 18, 2011 15:49
-
-
Save pjedrzejewski/1225191 to your computer and use it in GitHub Desktop.
Symfony2 configuration processor, gist #2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Sylius package. | |
* | |
* (c) Paweł Jędrzejewski | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Sylius\Bundle\ThemingBundle\Packager; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | |
/** | |
* Theme pack configuration. | |
* | |
* @author Paweł Jędrzejewski <[email protected]> | |
*/ | |
class Configuration implements ConfigurationInterface | |
{ | |
public function getConfigTreeBuilder() | |
{ | |
$treeBuilder = new TreeBuilder(); | |
$rootNode = $treeBuilder->root('theme'); | |
$rootNode | |
->addDefaultsIfNotSet() | |
->children() | |
->scalarNode('name')->isRequired()->cannotBeEmpty()->end() | |
->scalarNode('version')->isRequired()->cannotBeEmpty()->end() | |
->scalarNode('description')->defaultValue('...')->end() | |
->end(); | |
return $treeBuilder; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment