CraueFormFlowBundle icon indicating copy to clipboard operation
CraueFormFlowBundle copied to clipboard

Dynamic load of Form Class

Open peterfour opened this issue 10 years ago • 1 comments

Is there an easy way to dynamically change the form used by a specific step

For instance if my third step can be one of several different but is dependant of the value chosen on the second one. Which feature do I have to use to achieve that ?

peterfour avatar Sep 21 '15 16:09 peterfour

I tried this :

'form_type' => function(FormFlowInterface $flow) {
    return $flow->getFormData()->getType();
}

but it doesn't like having a closure, same goes with

'form_type' => $this->getFormData()->getType()

The thing the entity seems to be always null for some reason

peterfour avatar Sep 23 '15 15:09 peterfour