core icon indicating copy to clipboard operation
core copied to clipboard

How can I override Flight::json()

Open crazedVic opened this issue 7 years ago • 1 comments

I would like to pass back additional headers, right now there’s no option to do so, so i’d Like to override the function on line 467 in Engine.php. Accept additional headers in an array, that sort of thing?

crazedVic avatar Nov 17 '18 06:11 crazedVic

Try

\Flight::map('json', function ($data, $code = 200, $encode = true, $charset = 'utf-8')
  {
   // your code here
  });

erkinsergey avatar Nov 18 '18 16:11 erkinsergey

Seems addressed

n0nag0n avatar Jan 03 '24 21:01 n0nag0n