Skip to content

Tag: slim

Slim framework 4; return Formr-form

In Slim framework 4; How can I return a Formr-form in my controller as a response to a get-request? The code outputs nothing. However, if I uncomment the two lines, it outputs (as expected): Answer From Formr documentations: Formr will automatically echo form elements and messages to the screen, and this is u…

Capture Request state at the time of an exception

I have a Slim Framework application with a custom errorHandler, and a small middleware stack. My middleware adds attributes to the Request object which I would like to have access to from my error handler in the event of an exception. For example: The attribute does not exist within the Request object inside …

file_get_contents not working with bearer

I keep getting this error Warning: file_get_contents failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized Code The middleware i am using with my api accepts the authorization via url parameter or header; If I use the token in the parameter, it works but not being able to send it via header on…