vendor/sonata-project/formatter-bundle/src/SonataFormatterBundle.php line 20

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sonata Project package.
  4.  *
  5.  * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  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 Sonata\FormatterBundle;
  11. use FOS\CKEditorBundle\Form\Type\CKEditorType as FOSCKEditorType;
  12. use Ivory\CKEditorBundle\Form\Type\CKEditorType as IvoryCKEditorType;
  13. use Sonata\CoreBundle\Form\FormHelper;
  14. use Symfony\Component\DependencyInjection\ContainerBuilder;
  15. use Symfony\Component\HttpKernel\Bundle\Bundle;
  16. class SonataFormatterBundle extends Bundle
  17. {
  18.     public function build(ContainerBuilder $container)
  19.     {
  20.         $this->registerFormMapping();
  21.     }
  22.     public function boot()
  23.     {
  24.         $this->registerFormMapping();
  25.     }
  26.     public function registerFormMapping()
  27.     {
  28.         FormHelper::registerFormTypeMapping([
  29.             'ckeditor' => class_exists(FOSCKEditorType::class) ? FOSCKEditorType::class : IvoryCKEditorType::class,
  30.             'sonata_formatter_type' => 'Sonata\FormatterBundle\Form\Type\FormatterType',
  31.             'sonata_simple_formatter_type' => 'Sonata\FormatterBundle\Form\Type\SimpleFormatterType',
  32.         ]);
  33.     }
  34. }