public function build(FormFactoryInterface $form_factory, $data = null)
    {
        $options = is_callable($this->options) ? call_user_func($this->options, $data) : $this->options;

        if (null !== $this->name) {
            $form = $form_factory->createNamed($this->name, $this->type, $data, $options);
        } else {
            $form = $form_factory->create($this->type, $data, $options);
        }

        return new FormSubmitProcessor($form, $this->on_success, $this->on_failure, $this->form_submit_processor);
    }
public function build(FormFactoryInterface $form_factory, $data = null)
    {
        $options = is_callable($this->options) ? call_user_func($this->options, $data) : $this->options;

        if (null !== $this->name) {
            $form = $form_factory->createNamed($this->name, $this->type, $data, $options);
        } else {
            $form = $form_factory->create($this->type, $data, $options);
        }

        return new FormSubmitProcessor($form, $this->on_success, $this->on_failure, $this->form_submit_processor);
    }
public function build ( FormFactoryInterface $ form_factory , $ data = null ) { $ options = is_callable ( $ this -> options ) ? call_user_func ( $ this -> options , $ data ) : $ this -> options ; if ( null !== $ this -> name ) { $ form = $ form_factory -> createNamed ( $ this -> name , $ this -> type , $ data , $ options ) ; } else { $ form = $ form_factory -> create ( $ this -> type , $ data , $ options ) ; } return new FormSubmitProcessor ( $ form , $ this -> on_success , $ this -> on_failure , $ this -> form_submit_processor ) ; }
Create a handler which is able to process the request.

@param FormFactoryInterface $form_factory
@param mixed                $data
@return FormSubmitProcessor
Create a handler which is able to process the request .