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


PHP NodeBuilder::variableNode方法代碼示例

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


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

示例1: createAddPackageTaskNodes

 /**
  * Add the nodes for the "add-package" task.
  *
  * @param NodeBuilder $tasks The node builder.
  *
  * @return void
  *
  * @throws \InvalidArgumentException Will be thrown by the nodes when the input was invalid.
  */
 private function createAddPackageTaskNodes(NodeBuilder $tasks)
 {
     $tasks->scalarNode('name')->info('The name of the package to include.')->cannotBeEmpty()->validate()->always($this->enforceTypeStringCheck('Invalid package name %s'));
     $tasks->scalarNode('include_require')->info('The dependencies to include or true to include all.')->cannotBeEmpty()->defaultTrue()->validate()->always($this->enforceTypeArrayOrBoolCheck('Invalid value for include_require: %s'));
     $tasks->scalarNode('include_requiredev')->info('The dev dependencies to include or true to include all.')->cannotBeEmpty()->defaultFalse()->validate()->always($this->enforceTypeArrayOrBoolCheck('Invalid value for include_requiredev: %s'));
     $tasks->arrayNode('exclude_dependencies')->prototype('scalar')->info('The dependencies to exclude.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for exclude_dependencies: %s'));
     $tasks->arrayNode('include_files')->prototype('scalar')->info('The files to include.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for include_files: %s'));
     $tasks->arrayNode('exclude_files')->prototype('scalar')->info('The files to exclude.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for exclude_files: %s'));
     $tasks->arrayNode('rewrite_paths')->prototype('scalar')->info('The paths to rewrite.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for rewrite_paths: %s'));
     $tasks->variableNode('package_override')->info('The values to override for certain packages.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->createPackageOverrideMangler());
 }
開發者ID:cyberspectrum,項目名稱:pharpiler,代碼行數:20,代碼來源:Configuration.php

示例2: appendDataGridDefinition

 /**
  * @param NodeBuilder $dataGridDefinition
  */
 protected function appendDataGridDefinition(NodeBuilder $dataGridDefinition)
 {
     $dataGridDefinition->variableNode('filter_config')->end()->scalarNode('form_theme')->defaultNull()->end()->scalarNode('parent')->defaultNull()->end()->scalarNode('renderer')->defaultNull()->end()->variableNode('actions')->end()->variableNode('submit_button')->defaultValue([])->end()->variableNode('reset_button')->defaultValue([])->end()->arrayNode('columns')->prototype('array')->children()->scalarNode('template')->defaultNull()->end()->scalarNode('sort_column')->defaultNull()->end()->scalarNode('property_path')->defaultNull()->end()->scalarNode('label')->defaultNull()->end()->scalarNode('renderer')->defaultNull()->end()->variableNode('formatting_options')->defaultValue([])->end()->end()->end()->end();
 }
開發者ID:VincentChalnot,項目名稱:SidusDataGridBundle,代碼行數:7,代碼來源:Configuration.php


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