Closed oscarlosan closed 4 months ago
With the 3.5 release, we had to overhaul how the output buffer works. You have a couple options, some simpler than others to get it working again.
Flight::set('flight.v2.output_buffering', true);
https://docs.flightphp.com/learn/migrating-to-v3 - This will implement the default behavior you're likely used to.Flight::response()->body
property. Although as I write this out, there isn't a way to completely overwrite the body without calling Flight::response()->clear()
and then running your minified function on the existing body
content.As a side note, I didn't see you close the output buffer, which might be part of the issue? Usually there's something like a ob_end_clean(); to properly close the output buffer (which was part of the problem that was addressed in the 3.5 update).
Thank you very much for your support so quickly.
FYI. Created this pull request which might be what you're after if you want to fully move to v3. https://github.com/flightphp/core/pull/571
Hello, before I used the following function to minify my html and it worked for me. With flightphp it does not minimize the html. Is there something stopping ob_start?
`<?php ob_start("minifier"); function minifier($code) { $search = array(
}`