form_debug.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\Form\Extension\DataCollector\FormDataCollector;
  12. use Symfony\Component\Form\Extension\DataCollector\FormDataExtractor;
  13. use Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy;
  14. use Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension;
  15. use Symfony\Component\Form\ResolvedFormTypeFactory;
  16. return static function (ContainerConfigurator $container) {
  17. $container->services()
  18. ->set('form.resolved_type_factory', ResolvedTypeFactoryDataCollectorProxy::class)
  19. ->args([
  20. inline_service(ResolvedFormTypeFactory::class),
  21. service('data_collector.form'),
  22. ])
  23. ->set('form.type_extension.form.data_collector', DataCollectorTypeExtension::class)
  24. ->args([service('data_collector.form')])
  25. ->tag('form.type_extension')
  26. ->set('data_collector.form.extractor', FormDataExtractor::class)
  27. ->set('data_collector.form', FormDataCollector::class)
  28. ->args([service('data_collector.form.extractor')])
  29. ->tag('data_collector', ['template' => '@WebProfiler/Collector/form.html.twig', 'id' => 'form', 'priority' => 310])
  30. ;
  31. };