Skip to content
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