當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BuilderConfiguration::getParameterBag方法代碼示例

本文整理匯總了PHP中Symfony\Components\DependencyInjection\BuilderConfiguration::getParameterBag方法的典型用法代碼示例。如果您正苦於以下問題:PHP BuilderConfiguration::getParameterBag方法的具體用法?PHP BuilderConfiguration::getParameterBag怎麽用?PHP BuilderConfiguration::getParameterBag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Components\DependencyInjection\BuilderConfiguration的用法示例。


在下文中一共展示了BuilderConfiguration::getParameterBag方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parseParameters

 protected function parseParameters(BuilderConfiguration $configuration, $xml, $file)
 {
     if (!$xml->parameters) {
         return;
     }
     $configuration->getParameterBag()->add($xml->parameters->getArgumentsAsPhp('parameter'));
 }
開發者ID:bill97420,項目名稱:symfony,代碼行數:7,代碼來源:XmlFileLoader.php

示例2: testGetParameterBag

 /**
  * @covers Symfony\Components\DependencyInjection\BuilderConfiguration::getParameterBag
  */
 public function testGetParameterBag()
 {
     $configuration = new BuilderConfiguration();
     $this->assertEquals(array(), $configuration->getParameterBag()->all(), '->getParameterBag() returns an empty bag if no parameter has been defined');
     $configuration = new BuilderConfiguration(array(), new ParameterBag(array('foo' => 'bar')));
     $this->assertEquals(array('foo' => 'bar'), $configuration->getParameterBag()->all(), '->getParameterBag() returns the parameter bag passed at construction time');
 }
開發者ID:bill97420,項目名稱:symfony,代碼行數:10,代碼來源:BuilderConfigurationTest.php

示例3: merge

 /**
  * Merges a BuilderConfiguration with the current one.
  *
  * @param BuilderConfiguration $configuration
  *
  * @return BuilderConfiguration The current instance
  */
 public function merge(BuilderConfiguration $configuration = null)
 {
     if (null === $configuration) {
         return;
     }
     $this->addDefinitions($configuration->getDefinitions());
     $this->addAliases($configuration->getAliases());
     $this->parameterBag->add($configuration->getParameterBag()->all());
     foreach ($configuration->getResources() as $resource) {
         $this->addResource($resource);
     }
     return $this;
 }
開發者ID:klaasn,項目名稱:symfony-sandbox,代碼行數:20,代碼來源:BuilderConfiguration.php


注:本文中的Symfony\Components\DependencyInjection\BuilderConfiguration::getParameterBag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。