A redirect call () throws an HTTP redirect . Nothing happens after the redirect because CakePHP just stops. Everything that you put after the redirection call will not be executed. Instead, the browser simply issues a new HTTP GET URL to which you redirect.
The call to render () just loads the view. It takes a path to the view, not the URL. It is not redirected. Suppose $ userID is "101" in your case. The render () call will attempt to load the following file:
application / views / Formwork / Home / 101.ctp
Since this file does not exist, nothing happens.
Sander marechal
source share