本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\TreeBuilder::root方法的典型用法代码示例。如果您正苦于以下问题:PHP TreeBuilder::root方法的具体用法?PHP TreeBuilder::root怎么用?PHP TreeBuilder::root使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Config\Definition\Builder\TreeBuilder
的用法示例。
在下文中一共展示了TreeBuilder::root方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigTreeBuilder
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('brother_contact_us');
$treeBuilder->root('brother_contact_us')->children()->scalarNode('db_driver')->defaultValue('orm')->end()->booleanNode('notify_admin')->defaultFalse()->end()->scalarNode('date_format')->defaultValue('d/m/Y H:i:s')->end()->scalarNode('user_class')->defaultValue('AppBundle\\Entity\\User\\User')->end()->arrayNode('mailer')->addDefaultsIfNotSet()->children()->scalarNode('admin_email')->defaultValue('admin@localhost.com')->end()->scalarNode('sender_email')->defaultValue('admin@localhost.com')->end()->scalarNode('email_title')->defaultValue('New contact_us entry from {name}')->end()->end()->end()->arrayNode('form')->addDefaultsIfNotSet()->children()->arrayNode('entry')->addDefaultsIfNotSet()->children()->scalarNode('name')->cannotBeEmpty()->defaultValue('brother_contact_us_entry')->end()->scalarNode('type')->cannotBeEmpty()->defaultValue('brother_contact_us_entry')->end()->scalarNode('class')->cannotBeEmpty()->defaultValue('Brother\\ContactUsBundle\\Form\\Type\\EntryType')->end()->end()->end()->end()->end()->arrayNode('class')->addDefaultsIfNotSet()->children()->scalarNode('mailer')->cannotBeEmpty()->defaultValue('Brother\\ContactUsBundle\\Mailer\\Mailer')->end()->scalarNode('model')->cannotBeEmpty()->end()->scalarNode('manager')->cannotBeEmpty()->end()->end()->end()->arrayNode('service')->addDefaultsIfNotSet()->children()->scalarNode('mailer')->cannotBeEmpty()->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例2: getConfigTreeBuilder
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('brother_contacts');
$treeBuilder->root('brother_contacts')->children()->scalarNode('db_driver')->defaultValue('orm')->end()->arrayNode('class')->addDefaultsIfNotSet()->children()->scalarNode('model')->cannotBeEmpty()->end()->scalarNode('manager')->cannotBeEmpty()->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例3: getWaiterNodes
private function getWaiterNodes(array $except = [])
{
$builder = new TreeBuilder();
$nodes = [];
if (!in_array('count_limited', $except)) {
$maxNode = $builder->root('count_limited');
$strategyChildren = $maxNode->children()->integerNode('count')->isRequired()->end()->arrayNode('waiter')->isRequired()->children();
array_push($except, 'count_limited');
foreach ($this->getWaiterNodes($except) as $node) {
$strategyChildren->append($node);
}
$nodes[] = $maxNode;
}
if (!in_array('exponential_back_off', $except)) {
$exponentialNode = $builder->root('exponential_back_off');
$strategyChildren = $exponentialNode->children()->integerNode('exponent')->isRequired()->end()->arrayNode('waiter')->isRequired()->children();
array_push($except, 'exponential_back_off');
foreach ($this->getWaiterNodes($except) as $node) {
$strategyChildren->append($node);
}
$nodes[] = $exponentialNode;
}
if (!in_array('null', $except)) {
$nodes[] = $builder->root('null');
}
if (!in_array('sleep', $except)) {
$nodes[] = $builder->root('sleep');
}
return $nodes;
}
示例4: newBuilder
/**
* @api
*
* @param string $name
*
* @return $this
*/
public function newBuilder($name = null)
{
if ($name === null) {
throw RuntimeException::create()->setMessage('Builder name must be provided when creating tree builders.');
}
$this->setTreeBuilder(new TreeBuilder());
$this->setNodeDefinition($this->treeBuilder->root($name));
return $this;
}
示例5: getConfigTreeBuilder
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sonata_news');
$rootNode->children()->scalarNode('title')->isRequired()->end()->scalarNode('link')->isRequired()->end()->scalarNode('description')->isRequired()->end()->scalarNode('permalink_generator')->defaultValue('sonata.news.permalink.date')->end()->scalarNode('salt')->isRequired()->end()->arrayNode('permalink')->addDefaultsIfNotSet()->children()->scalarNode('date')->defaultValue('%%1$04d/%%2$d/%%3$d/%%4$s')->end()->end()->end()->arrayNode('table')->addDefaultsIfNotSet()->children()->scalarNode('post_tag')->defaultValue('news__post_tag')->end()->end()->end()->arrayNode('class')->addDefaultsIfNotSet()->children()->scalarNode('tag')->defaultValue('Application\\Sonata\\ClassificationBundle\\Entity\\Tag')->end()->scalarNode('collection')->defaultValue('Application\\Sonata\\ClassificationBundle\\Entity\\Collection')->end()->scalarNode('post')->defaultValue('Application\\Sonata\\NewsBundle\\Entity\\Post')->end()->scalarNode('comment')->defaultValue('Application\\Sonata\\NewsBundle\\Entity\\Comment')->end()->scalarNode('media')->defaultValue('Application\\Sonata\\MediaBundle\\Entity\\Media')->end()->scalarNode('user')->defaultValue('Application\\Sonata\\UserBundle\\Entity\\User')->end()->end()->end()->arrayNode('admin')->addDefaultsIfNotSet()->children()->arrayNode('post')->addDefaultsIfNotSet()->children()->scalarNode('class')->cannotBeEmpty()->defaultValue('Sonata\\NewsBundle\\Admin\\PostAdmin')->end()->scalarNode('controller')->cannotBeEmpty()->defaultValue('SonataAdminBundle:CRUD')->end()->scalarNode('translation')->cannotBeEmpty()->defaultValue('SonataNewsBundle')->end()->end()->end()->arrayNode('comment')->addDefaultsIfNotSet()->children()->scalarNode('class')->cannotBeEmpty()->defaultValue('Sonata\\NewsBundle\\Admin\\CommentAdmin')->end()->scalarNode('controller')->cannotBeEmpty()->defaultValue('SonataNewsBundle:CommentAdmin')->end()->scalarNode('translation')->cannotBeEmpty()->defaultValue('SonataNewsBundle')->end()->end()->end()->end()->end()->arrayNode('comment')->children()->arrayNode('notification')->children()->arrayNode('emails')->prototype('scalar')->cannotBeEmpty()->end()->end()->scalarNode('from')->cannotBeEmpty()->end()->scalarNode('template')->cannotBeEmpty()->end()->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例6: getConfigTreeBuilder
/**
* Generates the configuration tree.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sonata_doctrine_orm_admin', 'array');
$rootNode->children()->scalarNode('entity_manager')->defaultNull()->end()->arrayNode('audit')->addDefaultsIfNotSet()->children()->booleanNode('force')->defaultTrue()->end()->end()->end()->arrayNode('templates')->addDefaultsIfNotSet()->children()->arrayNode('form')->prototype('scalar')->end()->defaultValue(array('SonataDoctrineORMAdminBundle:Form:form_admin_fields.html.twig'))->end()->arrayNode('filter')->prototype('scalar')->end()->defaultValue(array('SonataDoctrineORMAdminBundle:Form:filter_admin_fields.html.twig'))->end()->arrayNode('types')->children()->arrayNode('list')->useAttributeAsKey('name')->prototype('scalar')->end()->end()->arrayNode('show')->useAttributeAsKey('name')->prototype('scalar')->end()->end()->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例7: getConfigTreeBuilder
/**
* Generates the configuration tree builder for the shopify configuration entries
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('codecloud_shopify');
$rootNode->children()->arrayNode('credentials')->cannotBeEmpty()->children()->scalarNode('api_key')->cannotBeEmpty()->end()->scalarNode('shared_secret')->cannotBeEmpty()->end()->end()->end()->arrayNode('oauth')->children()->scalarNode('step1')->cannotBeEmpty()->end()->scalarNode('step2')->cannotBeEmpty()->end()->scalarNode('step3')->cannotBeEmpty()->end()->end()->end()->arrayNode('twig')->children()->scalarNode('enabled_embedded_helpers')->end()->end()->end()->end();
return $treeBuilder;
}
示例8: getConfigTreeBuilder
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('eko_google_translate');
$rootNode->children()->scalarNode('api_key')->isRequired()->end()->end();
return $treeBuilder;
}
示例9: getConfigTreeBuilder
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('xoeoro_bytehand');
$rootNode->children()->scalarNode('id')->isRequired()->end()->scalarNode('key')->isRequired()->end()->scalarNode('from')->defaultValue('SMS-INFO')->end()->end();
return $treeBuilder;
}
示例10: getConfigTreeBuilder
/**
* @inheritDoc
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('bravesheep_flysystem_url');
$rootNode->children()->arrayNode('encoders')->addDefaultsIfNotSet()->children()->arrayNode('public_url_prefix')->addDefaultsIfNotSet()->children()->scalarNode('default')->defaultNull()->end()->scalarNode('web_dir')->defaultValue('%kernel.root_dir%/../web')->end()->end()->end()->end()->end()->arrayNode('urls')->prototype('array')->children()->scalarNode('url')->isRequired()->end()->scalarNode('prefix')->isRequired()->end()->arrayNode('encoders')->prototype('scalar')->end()->defaultValue(['oneup_flysystem', 'public_url_prefix'])->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例11: getConfigTreeBuilder
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('meup_tagcommander');
$rootNode->children()->scalarNode('default_event')->defaultValue('default')->end()->arrayNode('datalayer')->children()->scalarNode('name')->defaultValue('tc_vars')->end()->variableNode('default')->end()->end()->end()->arrayNode('containers')->isRequired()->requiresAtLeastOneElement()->prototype('array')->children()->scalarNode('name')->isRequired()->end()->scalarNode('script')->isRequired()->end()->scalarNode('version')->defaultValue('')->end()->scalarNode('alternative')->defaultValue('')->end()->end()->end()->end()->arrayNode('events')->isRequired()->requiresAtLeastOneElement()->prototype('array')->children()->scalarNode('name')->end()->scalarNode('function')->end()->end()->end()->end()->end();
return $treeBuilder;
}
示例12: getConfigTreeBuilder
/**
* Generates the configuration tree.
*
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('react_integration');
$rootNode->children()->integerNode('test1')->end()->booleanNode('test2')->end()->end();
return $treeBuilder;
}
示例13: getConfigTreeBuilder
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('d_labs_worker');
$rootNode->children()->arrayNode('redis')->prototype('array')->children()->scalarNode('client')->end()->end()->end()->end();
return $treeBuilder;
}
示例14: getConfigTreeBuilder
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root($this->rootNodeName);
$this->addConnectionsSection($rootNode);
return $treeBuilder;
}
示例15: getConfigTreeBuilder
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('espend_idea_badge');
$rootNode->children()->scalarNode('badge_lifetime')->defaultValue(3600)->end()->scalarNode('route_path')->defaultValue('/badge/{id}/{provider}')->end()->scalarNode('badge_controller')->defaultValue('espend_idea_badge_bundle.badge.controller:showAction')->end()->scalarNode('monthly_storage_path')->isRequired()->end()->end();
return $treeBuilder;
}