Timeline for How do I redirect users and show a message?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 9, 2018 at 8:29 | comment | added | jepster | "return $this->redirect('my.route')->send();" did the trick. Thanks! | |
Dec 12, 2016 at 4:21 | comment | added | Eugene | Yes, it will work, but the message will be not displayed as I explained in the initial message of this thread. Unfortunately it's not solution for my case :( | |
Dec 11, 2016 at 21:56 | comment | added | masterchief | @Eugene it may work in hook_form_alter(), but you will not have access to the $this->redirect function (that comes from UrlGeneratorTrait). That means you'll need to create a \Drupal\Core\Url object and pass that into a \Symfony\Component\HttpFoundation\RedirectResponse object and return that. It'll have the same affect though. | |
Dec 9, 2016 at 5:34 | comment | added | Eugene | Does it means that your approach will not work for hook_form_alter()? How can I use your approach for node edit form? | |
Dec 8, 2016 at 21:41 | comment | added | masterchief | @Eugene buildForm is part of the Form controller class that extends \Drupal\Core\Form\FormBase. For example valuebound.com/resources/blog/… the buildForm function is inside the ResumeForm class. | |
Dec 8, 2016 at 17:37 | comment | added | Eugene | Where is located this function buildForm? | |
Dec 1, 2016 at 23:20 | history | answered | masterchief | CC BY-SA 3.0 |