Controller/ExportController.php
protected function createCreateFormExport($alias, $step, $data = array())
    {
        /* @var $exportManager \Chill\MainBundle\Export\ExportManager */
        $exportManager = $this->get('chill.main.export_manager');
        $isGenerate = strpos($step, 'generate_') === 0;
        
        $builder = $this->get('form.factory')
              ->createNamedBuilder(null, FormType::class, array(), array(
                    'method' => $isGenerate ? 'GET' : 'POST',
                    'csrf_protection' => $isGenerate ? false : true,              
              ));
        
        if ($step === 'centers' or $step === 'generate_centers') {
            $builder->add('centers', PickCenterType::class, array(
               'export_alias' => $alias 
            ));
        }
        
        if ($step === 'export' or $step === 'generate_export') {
            $builder->add('export', ExportType::class, array(
               'export_alias' => $alias,
               'picked_centers' => $exportManager->getPickedCenters($data['centers'])
            ));
        }
        
        if ($step === 'formatter' or $step === 'generate_formatter') {
            $builder->add('formatter', FormatterType::class, array(
                'formatter_alias' => $exportManager
                     ->getFormatterAlias($data['export']),
                'export_alias' => $alias,
                'aggregator_aliases' => $exportManager
                    ->getUsedAggregatorsAliases($data['export'])
            ));
        }
        
        $builder->add('submit', 'submit', array(
            'label' => 'Generate'
        ));
        
        return $builder->getForm();
    }
protected function createCreateFormExport($alias, $step, $data = array())
    {
        /* @var $exportManager \Chill\MainBundle\Export\ExportManager */
        $exportManager = $this->get('chill.main.export_manager');
        $isGenerate = strpos($step, 'generate_') === 0;
        
        $builder = $this->get('form.factory')
              ->createNamedBuilder(null, FormType::class, array(), array(
                    'method' => $isGenerate ? 'GET' : 'POST',
                    'csrf_protection' => $isGenerate ? false : true,              
              ));
        
        if ($step === 'centers' or $step === 'generate_centers') {
            $builder->add('centers', PickCenterType::class, array(
               'export_alias' => $alias 
            ));
        }
        
        if ($step === 'export' or $step === 'generate_export') {
            $builder->add('export', ExportType::class, array(
               'export_alias' => $alias,
               'picked_centers' => $exportManager->getPickedCenters($data['centers'])
            ));
        }
        
        if ($step === 'formatter' or $step === 'generate_formatter') {
            $builder->add('formatter', FormatterType::class, array(
                'formatter_alias' => $exportManager
                     ->getFormatterAlias($data['export']),
                'export_alias' => $alias,
                'aggregator_aliases' => $exportManager
                    ->getUsedAggregatorsAliases($data['export'])
            ));
        }
        
        $builder->add('submit', 'submit', array(
            'label' => 'Generate'
        ));
        
        return $builder->getForm();
    }
protected function createCreateFormExport ( $ alias , $ step , $ data = array ( ) ) { /* @var $exportManager \Chill\MainBundle\Export\ExportManager */ $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ isGenerate = strpos ( $ step , 'generate_' ) === 0 ; $ builder = $ this -> get ( 'form.factory' ) -> createNamedBuilder ( null , FormType :: class , array ( ) , array ( 'method' => $ isGenerate ? 'GET' : 'POST' , 'csrf_protection' => $ isGenerate ? false : true , ) ) ; if ( $ step === 'centers' or $ step === 'generate_centers' ) { $ builder -> add ( 'centers' , PickCenterType :: class , array ( 'export_alias' => $ alias ) ) ; } if ( $ step === 'export' or $ step === 'generate_export' ) { $ builder -> add ( 'export' , ExportType :: class , array ( 'export_alias' => $ alias , 'picked_centers' => $ exportManager -> getPickedCenters ( $ data [ 'centers' ] ) ) ) ; } if ( $ step === 'formatter' or $ step === 'generate_formatter' ) { $ builder -> add ( 'formatter' , FormatterType :: class , array ( 'formatter_alias' => $ exportManager -> getFormatterAlias ( $ data [ 'export' ] ) , 'export_alias' => $ alias , 'aggregator_aliases' => $ exportManager -> getUsedAggregatorsAliases ( $ data [ 'export' ] ) ) ) ; } $ builder -> add ( 'submit' , 'submit' , array ( 'label' => 'Generate' ) ) ; return $ builder -> getForm ( ) ; }
create a form to show on different steps.

@param string $alias
@param string $step, can either be 'export', 'formatter', 'generate_export' or 'generate_formatter' (last two are used by generate action)
@param array $data the data from previous step. Required for steps 'formatter' and 'generate_formatter'
@return \Symfony\Component\Form\Form
create a form to show on different steps .