AdminBundle/DependencyInjection/Configuration.php
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('admin');

        $rootNode
            ->children()
                ->arrayNode('admin_menus')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->scalarNode('icon_class')->defaultNull()->end()
                            ->scalarNode('label')->defaultNull()->end()
                            //fix expected always array
                            ->variableNode('options')
                                ->validate()
                                ->always(function ($v) {
                                    if (is_string($v) || is_array($v)) {
                                        return $v;
                                    }
                                    throw new InvalidTypeException();
                                })
                            ->end()->end()
                        
                        
//                            ->arrayNode('options')
//                                ->useAttributeAsKey('name')
//                                ->prototype('array')
//                                    ->ignoreExtraKeys()
//                                    ->children()
//                                        ->scalarNode('icon_class')->defaultNull()->end()
//                                        ->scalarNode('label')->defaultNull()->end()
//                                        ->arrayNode('options')
//                                            ->useAttributeAsKey('name')
//                                            ->prototype('scalar')->end()
//                                        ->end()
//                                    ->end()
//                                ->end()
//                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('company_menus')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->scalarNode('icon_class')->defaultNull()->end()
                            ->scalarNode('label')->defaultNull()->end()
                            //fix expected always array
                            ->variableNode('options')
                                ->validate()
                                ->always(function ($v) {
                                    if (is_string($v) || is_array($v)) {
                                        return $v;
                                    }
                                    throw new InvalidTypeException();
                                })
                            ->end()->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('apis')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->arrayNode('options')
                            ->useAttributeAsKey('name')
                            ->prototype('scalar')->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
        return $treeBuilder;
    }
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('admin');

        $rootNode
            ->children()
                ->arrayNode('admin_menus')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->scalarNode('icon_class')->defaultNull()->end()
                            ->scalarNode('label')->defaultNull()->end()
                            //fix expected always array
                            ->variableNode('options')
                                ->validate()
                                ->always(function ($v) {
                                    if (is_string($v) || is_array($v)) {
                                        return $v;
                                    }
                                    throw new InvalidTypeException();
                                })
                            ->end()->end()
                        
                        
//                            ->arrayNode('options')
//                                ->useAttributeAsKey('name')
//                                ->prototype('array')
//                                    ->ignoreExtraKeys()
//                                    ->children()
//                                        ->scalarNode('icon_class')->defaultNull()->end()
//                                        ->scalarNode('label')->defaultNull()->end()
//                                        ->arrayNode('options')
//                                            ->useAttributeAsKey('name')
//                                            ->prototype('scalar')->end()
//                                        ->end()
//                                    ->end()
//                                ->end()
//                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('company_menus')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->scalarNode('icon_class')->defaultNull()->end()
                            ->scalarNode('label')->defaultNull()->end()
                            //fix expected always array
                            ->variableNode('options')
                                ->validate()
                                ->always(function ($v) {
                                    if (is_string($v) || is_array($v)) {
                                        return $v;
                                    }
                                    throw new InvalidTypeException();
                                })
                            ->end()->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('apis')
                    ->isRequired()
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->ignoreExtraKeys()
                        ->children()
                            ->arrayNode('options')
                            ->useAttributeAsKey('name')
                            ->prototype('scalar')->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
        return $treeBuilder;
    }
public function getConfigTreeBuilder ( ) { $ treeBuilder = new TreeBuilder ( ) ; $ rootNode = $ treeBuilder -> root ( 'admin' ) ; $ rootNode -> children ( ) -> arrayNode ( 'admin_menus' ) -> isRequired ( ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'array' ) -> ignoreExtraKeys ( ) -> children ( ) -> scalarNode ( 'icon_class' ) -> defaultNull ( ) -> end ( ) -> scalarNode ( 'label' ) -> defaultNull ( ) -> end ( ) //fix expected always array -> variableNode ( 'options' ) -> validate ( ) -> always ( function ( $ v ) { if ( is_string ( $ v ) || is_array ( $ v ) ) { return $ v ; } throw new InvalidTypeException ( ) ; } ) -> end ( ) -> end ( ) //                            ->arrayNode('options') //                                ->useAttributeAsKey('name') //                                ->prototype('array') //                                    ->ignoreExtraKeys() //                                    ->children() //                                        ->scalarNode('icon_class')->defaultNull()->end() //                                        ->scalarNode('label')->defaultNull()->end() //                                        ->arrayNode('options') //                                            ->useAttributeAsKey('name') //                                            ->prototype('scalar')->end() //                                        ->end() //                                    ->end() //                                ->end() //                            ->end() -> end ( ) -> end ( ) -> end ( ) -> arrayNode ( 'company_menus' ) -> isRequired ( ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'array' ) -> ignoreExtraKeys ( ) -> children ( ) -> scalarNode ( 'icon_class' ) -> defaultNull ( ) -> end ( ) -> scalarNode ( 'label' ) -> defaultNull ( ) -> end ( ) //fix expected always array -> variableNode ( 'options' ) -> validate ( ) -> always ( function ( $ v ) { if ( is_string ( $ v ) || is_array ( $ v ) ) { return $ v ; } throw new InvalidTypeException ( ) ; } ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) -> arrayNode ( 'apis' ) -> isRequired ( ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'array' ) -> ignoreExtraKeys ( ) -> children ( ) -> arrayNode ( 'options' ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'scalar' ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) ; return $ treeBuilder ; }
{@inheritdoc}
{