I am a PHP and Drupal 8 newbie. I am working on a module based on Drupal 8 Webform and remote post.

I'd like to loop the request sent rather than doing a request->get('keyname') on each. I'm hoping to using the parameter name to search another string and then replace it with the parameter's value in that string.

Any small foreach example would be appreciated.


Assuming $request is a Symfony request object:

foreach ($request->request->all() as $key => $value) {
  // ...

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.