I need to put a flag in an kernel.event_listener
at stage kernel.controller
in order to do something in an kernel.response
-listener.
I thought about adding a parameter to the $request
object, however have not found any method or this:
http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html
What is the best practice to pass some informatino from an kernel.controller
-listener to an kernel.response
-listener?
Use-case:
kernel.controller
-stage, since based on the result of the validation, the view may behave different).kernel.response
-listener, since it has the Response
-instance.To do http get request with parameters in Angular, we can make use of params options argument in HttpClient. get() method. Using the params property we can pass parameters to the HTTP get request. Either we can pass HttpParams or an object which contains key value pairs of parameters.
To send parameters in URL, write all parameter key:value pairs to a dictionary and send them as params argument to any of the GET, POST, PUT, HEAD, DELETE or OPTIONS request. then https://somewebsite.com/?param1=value1¶m2=value2 would be our final url.
In a POST request, the parameters are sent as a body of the request, after the headers. To do a POST with HttpURLConnection, you need to write the parameters to the connection after you have opened the connection.
GET parameters (also called URL parameters or query strings) are used when a client, such as a browser, requests a particular resource from a web server using the HTTP protocol. These parameters are usually name-value pairs, separated by an equals sign = . They can be used for a variety of things, as explained below.
You can use $request->attributes
to pass around information. In your controller listener:
$request->attributes->set('mykey', 'myvalue');
In your response listener:
$myvalue = $request->attributes->get('mykey');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With