2017 © Pedro Peláez
 

library form-handler

A Form Handler implementation for the Symfony Form Component

image

piwi91/form-handler

A Form Handler implementation for the Symfony Form Component

  • Monday, October 26, 2015
  • by piwi91
  • Repository
  • 2 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

FormHandler

Build Status, (*1)

This is a Form Handler implementation which I used in combination with the Symfony Form component., (*2)

Click here to go to the blog post I wrote about the form handler., (*3)

Usage

Implement the FormHandlerInterface OR extend the AbstractFormHandler and implement the postProcess method., (*4)

You can use a try/catch to catch validation exceptions., (*5)

Example:, (*6)

public function anActionInAController(Request $request)
{
    $formHandler = new MyFancyFormHandler($formFactory, $form);

    $form = $formHandler->form();

    if ($request->isMethod('POST') {
        try {
            $formHandler->process($form, $request);
        } catch (ValidationException $e) {
            // Do something with the validation... or not ;-) (and render the page including the validation errors)
        }
    }

    return $this->render('my_view.html.twig', ['form' => $form->createView()]);
}

The Versions

26/10 2015

dev-master

9999999-dev

A Form Handler implementation for the Symfony Form Component

  Sources   Download

MIT

The Requires

 

The Development Requires

17/09 2015

v1.0.0

1.0.0.0

A Form Handler implementation for the Symfony Form Component

  Sources   Download

MIT

The Requires

 

The Development Requires