PHPackages                             blixit/msf-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. blixit/msf-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

blixit/msf-bundle
=================

Multi step forms form Symfony 3

110PHP

Since Jun 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/blixit/MSFBundle-Symfony-3)[ Packagist](https://packagist.org/packages/blixit/msf-bundle)[ RSS](/packages/blixit-msf-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

MSF Bundle (Symfony 3)
======================

[](#msf-bundle-symfony-3)

A bundle to manage MultiStepsForms in Symfony 3

During a simple project, I found that there were not any bundle providing the Multiple Step Form feature. Actually, I found one,  . But for me, this bundle focuses too much on the Forms themselves, which was not relevant to me. For instance, I don't use to handle Form Event. Then, I came to the idea I could create a bundle which let developper interact with each form separately and then use a little well-configured system to manage the set of forms, the transitions between them, hydratation, ...

Therefore I created the MSFBundle. It's a little one with currently 5 or 6 classes and works out as a service. Its usage is very similar to forms themselves to reduce learning time.

You just need ONE MsfFormType CLASS to go !!

Bonus : with this system, it's easy to manage transitions even between MSF. You just have to configure actions at each step.

Example of Controller
---------------------

[](#example-of-controller)

```
/**
 * @Route("/msfbundle", name="msfbundle")
 * @return \Symfony\Component\HttpFoundation\Response
 */
public function indexAction(Request $request){

    //getting service and creating form
    $msf = $this->container->get('msf')->create(MSFTesterType::class,"blog");

    //getting symfony form
    $form = $msf->getForm();

    //request handling
    $form->handleRequest($request);

    if($form->isSubmitted() && $form->isValid() ) {
        //validation
        $msf->done() ;
    }

    return $this->render('BlixitMultiStepFormBundle:Default:default.html.twig',[
        'form'  =>  $form->createView(),
        'title' => $msf->getLabel(),
        'buttons' => $msf->getButtons(),
        'menu'  => $msf->getMenu('msfbundle'),
    ]);
}
```

Example of MSFFormType : MSFTesterType with transition callbacks
----------------------------------------------------------------

[](#example-of-msfformtype--msftestertype-with-transition-callbacks)

```
