8000 Explain sample configuration parameter usage by bennyt2 · Pull Request #5621 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Explain sample configuration parameter usage #5621

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

Merged
merged 1 commit into from
Apr 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Explain sample configuration parameter usage
The "Processing the ``$configs`` Array" section explains how to define parameters within the Configuration class and process them in the Extension. In my opinion, it doesn't take the example to a logical conclusion. People reading this file want to learn how to create configuration within a Bundle. It would be helpful to explain how the configuration can be used. Since the example uses parameters, I propose showing how the parameters can be loaded into the container. With these code changes, the `twitter.client_id` and `twitter.client_secret` are now available through use throughout the application.
  • Loading branch information
bennyt2 committed Aug 12, 2015
commit ceacc7c4a257da79944d710c35945666ce14c6bb
7 changes: 6 additions & 1 deletion cookbook/bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ thrown)::
$configuration = new Configuration();

$config = $this->processConfiguration($configuration, $configs);
// ...

// Example configuration parameter usage: Set configuration variables as
// parameters in the container.
$container->setParameter('twitter.client_id', $config['twitter']['client_id']);
$container->setParameter('twitter.client_secret', $config['twitter']['client_secret']);

}

The ``processConfiguration()`` method uses the configuration tree you've defined
Expand Down
0