0

is there a way to pass the form/input value from twig file to controller without using symfony?

Tried using getQueryParams but it only work if you put a value in the url.

Choy Roman
  • 7
  • 1
  • 2
  • As you tagged this with slim: – DarkBee Jul 20 '23 at 05:08
  • 1
    Does this answer your question? [Slim 3 - how to get all get/ put/ post variables?](https://stackoverflow.com/questions/32668186/slim-3-how-to-get-all-get-put-post-variables) – DarkBee Jul 20 '23 at 05:09
  • If it generates a HTML form, then will be posted back to the server as normal when you submit it. You could make it submit to anywhere. But if you send it to a PHP script then you can, at the very least, use vanilla PHP $_GET or $_POST to read the input parameters. But as above, if you're using a framework, just use that framework's normal procedures to read the values. Remember twig is just a template engine, to generate HTML. Once the browser receives the HTML, it's no different to HTML that was generated by another method. – ADyson Jul 20 '23 at 08:14
  • Thank you guys for the idea , i tried to used the $request->getParsedBody() , first the value is null but when submit id triggered it will eventually have. thank you – Choy Roman Jul 20 '23 at 12:28

0 Answers0