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
trafficstars

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