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


PHP NodeBuilder::booleanNode方法代碼示例

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


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

示例1: addClientConfiguration

 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $node
  */
 private function addClientConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('id')->isRequired()->cannotBeEmpty()->info('Your Billomat Id')->example('company_name');
     $node->scalarNode('api_key')->isRequired()->cannotBeEmpty()->info('Your Billomat API key')->example('12345abc67890def12345abc67890def');
     $children = $node->arrayNode('application')->addDefaultsIfNotSet()->children();
     $this->addApplicationConfiguration($children);
     $node->booleanNode('wait_for_rate_limit_reset')->defaultFalse()->info('Wait for rate limit reset if rate limit is reached during a request');
     $node->booleanNode('async')->defaultFalse()->info('Use asynchronous requests with the Guzzle Async Plugin');
 }
開發者ID:phobetor,項目名稱:billomat-bundle,代碼行數:12,代碼來源:Configuration.php

示例2: addGeneralSection

 private function addGeneralSection(NodeBuilder $pluginSection)
 {
     $plugin = $this->plugin;
     $pluginFqcn = get_class($plugin);
     $imgFolder = $plugin->getImgFolder();
     $ds = DIRECTORY_SEPARATOR;
     $pluginSection->booleanNode('has_options')->defaultFalse()->end()->scalarNode('icon')->validate()->ifTrue(function ($v) use($plugin) {
         return !call_user_func_array(__CLASS__ . '::isIconValid', array($v, $plugin));
     })->thenInvalid($pluginFqcn . " : this file was not found ({$imgFolder}{$ds}%s)")->end()->end()->end();
 }
開發者ID:claroline,項目名稱:distribution,代碼行數:10,代碼來源:Configuration.php

示例3: addConfiguration

 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end();
     foreach ($this->options as $name => $value) {
         if (is_bool($value)) {
             $node->booleanNode($name)->defaultValue($value);
         } else {
             $node->scalarNode($name)->defaultValue($value);
         }
     }
 }
開發者ID:noelg,項目名稱:symfony-demo,代碼行數:11,代碼來源:RememberMeFactory.php

示例4: addConfiguration

 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('provider')->end()->booleanNode('remember_me')->defaultTrue()->end()->scalarNode('success_handler')->end()->scalarNode('failure_handler')->end();
     foreach ($this->options as $name => $default) {
         if (is_bool($default)) {
             $node->booleanNode($name)->defaultValue($default);
         } else {
             $node->scalarNode($name)->defaultValue($default);
         }
     }
 }
開發者ID:noelg,項目名稱:symfony-demo,代碼行數:11,代碼來源:AbstractFactory.php

示例5: addDefinitions

 /**
  * Adds the definitions.
  *
  * @param NodeBuilder $node The node builder.
  */
 public function addDefinitions(NodeBuilder $node)
 {
     $node->booleanNode('uuid_handler')->info('Enable the UUID serialization handler for JMS?')->defaultTrue();
 }
開發者ID:kherge,項目名稱:uuid-bundle,代碼行數:9,代碼來源:UuidHandler.php


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