Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize readme file #4

Open
mickeyambrosius opened this issue Feb 1, 2014 · 2 comments
Open

Optimize readme file #4

mickeyambrosius opened this issue Feb 1, 2014 · 2 comments

Comments

@mickeyambrosius
Copy link

I found your nice UnifikDatabaseConfigBundle when searching for some database enabled configuration for Symfony. Been trying to set it up and finally succeeded, but I think something might be missing in the readme file. In order to have the configurator forms working I required the following setup in MyBundle\DependencyInjection\Controller.php.

(I found from debugging the code and afterwards found the text about it in ConfiguratorType, doh!)

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();

    $rootNode = $treeBuilder->root('bundle_alias');
    $rootNode
        ->children()
            ->arrayNode('globals')->attribute('configurator', true)
            ->children()
                ->arrayNode('shopify')->attribute('configurator', true)
                    ->children()
                        ->scalarNode('api_key')->attribute('configurator', true)->end()
                        ->scalarNode('api_secret')->attribute('configurator', true)->end()
                        ->scalarNode('api_scope')->attribute('configurator', true)->end()
                        ->scalarNode('api_token')->attribute('configurator', true)->end()
                        ->scalarNode('shop_name')->attribute('configurator', true)->end()
                    ->end()
                ->end()
            ->end()
        ->end()
    ;

    return $treeBuilder;
}

}

I think it would be a big help to point out in the readme how the getConfigTreeBuilder should be structured and the nodes decorated with 'configurator' attribute. Also it might make sense to point out that the ConfigurationTree needs to be modeled before the Bundle works. Last thing, I think it would help to specify the that it's the bundle alias being used in the container_extension table and maybe give an example (it might be common knowledge for a Symfony developer, but wouldn't hurt :)

Do let me know if I should contribute to the readme.

Thanks

@guillaume-petit
Copy link

I agree with you. I stumbled across the exact same problem and only found out by crawling in the code.

@hubertperron
Copy link
Contributor

The configurator form is still an experimental feature of the bundle and this is why it's not featured in the readme file.

But as this feature seems quite popular, i'll look into improving the documentation. Feel free to submit a PR to improve the documentation if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants