-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
I got error: Expected argument of type \"null\", \"Symfony\\Component… #6007
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ object to read data off of the correct PHP superglobals (i.e. ``$_POST`` or | |
Now, when you process a form, you can pass the :class:`Symfony\\Component\\HttpFoundation\\Request` | ||
object to :method:`Symfony\\Component\\Form\\Form::handleRequest`:: | ||
|
||
$form->handleRequest($request); | ||
$form->handleRequest(); | ||
|
||
.. note:: | ||
|
||
|
@@ -556,7 +556,7 @@ method: | |
|
||
$request = Request::createFromGlobals(); | ||
|
||
$form->handleRequest($request); | ||
$form->handleRequest(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
$formFactory = Forms::createFormFactoryBuilder()
->addExtension(new HttpFoundationExtension())
->getFormFactory(); This will add the |
||
|
||
if ($form->isValid()) { | ||
$data = $form->getData(); | ||
|
@@ -582,7 +582,7 @@ method: | |
->add('dueDate', 'date') | ||
->getForm(); | ||
|
||
$form->handleRequest($request); | ||
$form->handleRequest(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be reverted IMO, as this example shows the usage of the form component inside the Symfony framework. The |
||
|
||
if ($form->isValid()) { | ||
$data = $form->getData(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows the integration with the
HttpFoundation
component. It registers aHttpFoundationRequestHandler
which expects aRequest
instance.