@@ -317,26 +317,48 @@ Miscellaneous Functions
317317
318318.. php :function :: redirect(string $route)
319319
320- :param string $route: The reverse-routed or named route to redirect the user to.
320+ :param string $route: The route name or Controller::method to redirect the user to.
321321 :rtype: RedirectResponse
322322
323323 .. important :: When you use this function, an instance of ``RedirectResponse`` must be returned
324324 in the method of the :doc: `Controller <../incoming/controllers >` or
325325 the :doc: `Controller Filter <../incoming/filters >`. If you forget to return it,
326326 no redirection will occur.
327327
328- Returns a RedirectResponse instance allowing you to easily create redirects:
328+ Returns a RedirectResponse instance allowing you to easily create redirects.
329+
330+ **Redirect to a URI path **
331+
332+ When you want to pass a URI path (relative to baseURL), use ``redirect()->to() ``:
329333
330334 .. literalinclude :: common_functions/005.php
335+ :lines: 2-
331336
332- .. note :: ``redirect()->back()`` is not the same as browser "back" button.
333- It takes a visitor to "the last page viewed during the Session" when the Session is available.
334- If the Session hasn’t been loaded, or is otherwise unavailable, then a sanitized version of HTTP_REFERER will be used.
337+ **Redirect to a Defined Route **
338+
339+ When you want to pass a :ref: `route name <using-named-routes >` or Controller::method
340+ for :ref: `reverse routing <reverse-routing >`, use ``redirect()->route() ``:
341+
342+ .. literalinclude :: common_functions/013.php
343+ :lines: 2-
335344
336- When passing an argument into the function, it is treated as a named/reverse-routed route, not a relative/full URI,
345+ When passing an argument into the function, it is treated as a route name or
346+ Controller::method for reverse routing, not a relative/full URI,
337347 treating it the same as using ``redirect()->route() ``:
338348
339349 .. literalinclude :: common_functions/006.php
350+ :lines: 2-
351+
352+ **Redirect Back **
353+
354+ When you want to redirect back, use ``redirect()->back() ``:
355+
356+ .. literalinclude :: common_functions/014.php
357+ :lines: 2-
358+
359+ .. note :: ``redirect()->back()`` is not the same as browser "back" button.
360+ It takes a visitor to "the last page viewed during the Session" when the Session is available.
361+ If the Session hasn’t been loaded, or is otherwise unavailable, then a sanitized version of HTTP_REFERER will be used.
340362
341363.. php :function :: remove_invisible_characters($str[, $urlEncoded = true])
342364
0 commit comments