Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silex controller / Form parameters validation #88

Open
mcrio opened this issue Oct 28, 2018 · 0 comments
Open

Silex controller / Form parameters validation #88

mcrio opened this issue Oct 28, 2018 · 0 comments

Comments

@mcrio
Copy link

mcrio commented Oct 28, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant