From ceacc7c4a257da79944d710c35945666ce14c6bb Mon Sep 17 00:00:00 2001 From: Ben Thomas Date: Tue, 11 Aug 2015 23:11:38 -0400 Subject: [PATCH] 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. --- cookbook/bundles/configuration.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cookbook/bundles/configuration.rst b/cookbook/bundles/configuration.rst index f04f1018ccf..ad24bd33ad2 100644 --- a/cookbook/bundles/configuration.rst +++ b/cookbook/bundles/configuration.rst @@ -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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy