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

Commit 7c36043

Browse filesBrowse files
authentictechjaviereguiluz
authored andcommitted
Update routing.rst
Just adding the ? character to the route parameter without also adding ? to the function parameter type results in a TypeError: "Argument 1 passed to App\Controller\BlogController::list() must be of the type integer, null given"
1 parent 7874115 commit 7c36043
Copy full SHA for 7c36043

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎routing.rst

Copy file name to clipboardExpand all lines: routing.rst
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ parameter:
815815
.. tip::
816816

817817
To give a ``null`` default value to any parameter, add nothing after the
818-
``?`` character (e.g. ``/blog/{page?}``).
818+
``?`` character (e.g. ``/blog/{page?}``). Also, remember to add the
819+
``?`` character before the function parameter type to make it permit null values (e.g. ``?int``)
819820

820821
Parameter Conversion
821822
~~~~~~~~~~~~~~~~~~~~

0 commit comments

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