Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Simplify the form submission #27638

Copy link
Copy link
Closed
Closed
Copy link
@ismail1432

Description

@ismail1432
Issue body actions

Description
At the moment when you want to submit a form in a controller most of the time you should call 3 methods handleRequest($request) , isSubmitted() and isValid() see documentation and if you call isValid() without calling isSubmitted() before it will throw an Exception

I know it's little magic but the simple idea is to aggregate the 3 methods in 1.
the method will handle the request, check if the form isSubmitted and if it's valid.

Example

public function add(Request $request)
{
//create $form
//do some stuff
if($form->isCorrect($request)) {
// Do some stuff with $form
}

The method name is a simple example. I'am ready to work on if you're OK
I think the community have already spoken about that, but I'm not sure, WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FeatureForm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.