Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9e7f22

Browse filesBrowse files
committed
feature symfony#5621 Explain sample configuration parameter usage (bennyt2)
This PR was merged into the 2.7 branch. Discussion ---------- 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. Commits ------- ceacc7c Explain sample configuration parameter usage
2 parents 524c045 + ceacc7c commit d9e7f22
Copy full SHA for d9e7f22

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎bundles/configuration.rst

Copy file name to clipboardExpand all lines: bundles/configuration.rst
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@ thrown)::
223223
$configuration = new Configuration();
224224

225225
$config = $this->processConfiguration($configuration, $configs);
226-
// ...
226+
227+
// Example configuration parameter usage: Set configuration variables as
228+
// parameters in the container.
229+
$container->setParameter('twitter.client_id', $config['twitter']['client_id']);
230+
$container->setParameter('twitter.client_secret', $config['twitter']['client_secret']);
231+
227232
}
228233

229234
The ``processConfiguration()`` method uses the configuration tree you've defined

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.