i am currently adding the possibility to lock pages for visiters who are not logged in. So if the user is logged in, he sees the page and i f not he will be sent to the login page:
{{ go("/login") }}
The question is, can i pass values in this go-statement? I want to pass page.url so that i can reffer to the url in the controller of the login form, to sent the user back to the page he wanted to see after a successfull login.
I decided to realize it with params as you suggested.
{% set goPage = page.id %}
{{ go("/login?goThen="~goPage) }}
In my login controller i tried to get this param. But get the error “Undefined array key ‘goTo’”
I used the following simple code and dont know why this isnt working in this context: