0

I have a "redirect" query parameter in my URL. I get this parameter and after doing some things I want to redirect.

But the content() method is expected to return an array, so returning Symfony's RedirectResponse is giving me a warning in PHPStorm.

What is the correct way to do it?

Thanks.

  • 1
    Controllers that extend ControllerBase can return a render array or a Symfony Response object. Do you have a return type specified on the class method or something? See: drupal.stackexchange.com/q/255216/57 – Kevin Oct 17 '18 at 19:31
  • 1
    Yes, probably the example content() you used contains the annotation @return array. Remove this to get rid of the warning. – 4k4 Oct 17 '18 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.