Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afdb2c6

Browse files
committed
minor #12943 [Form] Use the get method instead of using the array (Arman-Hosseini)
This PR was merged into the 3.4 branch. Discussion ---------- [Form] Use the get method instead of using the array <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 0da5901 Use the get method instead of using the array
2 parents 81cb799 + 0da5901 commit afdb2c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controller/upload_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Finally, you need to update the code of the controller that handles the form::
143143

144144
if ($form->isSubmitted() && $form->isValid()) {
145145
/** @var UploadedFile $brochureFile */
146-
$brochureFile = $form['brochure']->getData();
146+
$brochureFile = $form->get('brochure')->getData();
147147

148148
// this condition is needed because the 'brochure' field is not required
149149
// so the PDF file must be processed only when a file is uploaded

0 commit comments

Comments
 (0)