Skip to content

Silex controller / Form parameters validation #88

Open
@mcrio

Description

@mcrio

Hi, in the Application > Request part of the book there is an example about using Silex to validate the form and proceed with user signup:

    // On a more elaborate Silex application that uses the Form 
    // component to capture and validate parameters, it would look like this:

    $app->match('/signup', function (Request $request) use ($app) {
    $form = $app['sign_up_form'];
    $form->handleRequest($request);

    if ($form->isValid()) {
        $data = $form->getData();
.....

As I understand you might be configuring additional validation rules for the Silex Form like validating email etc., and that those rules might be a copy of how the same data is validated in the domain model, which is probably hard to maintain?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions