php - Passing posted values from one controller to another in symfony -
I have two controllers. I get a problem from transmitting from one controller to another. This is a quick view,
This function is 1
Public function setroll (request $ request) {This-> Forwarded (path, array (role = & gt; $ role)); This- & gt; Redirect (path of the second controller); }
This function is 2.
public function getRole (request $ request) {$ role = $ request- & gt; ); // When printing this $ role, I'm able to get the value of $ role $ Sql = "Select from table where id = $ role"; // I can not get a value in this curie, besides, I can not give the price to submit a fourth file return ... (filename, array ('role' = & gt; $ role)); }
The problem is that I can use the variable "role" in my Twitter file of another controller, it always remains empty.
Is anything bad here?
You public function index ($ name) {$ response = $ this- & gt; Next ('AcmeHello bundle: hello: fancy', array ('role' => role of $)
)); // ... modify the forward response or return it straight away // but do not redirect later! // Return the response now that the forwarded controller returns the $ response; }
Comments
Post a Comment