mirror of https://github.com/flightphp/core
13 lines
351 B
13 lines
351 B
![]()
1 year ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
class OverwriteBodyMiddleware
|
||
|
{
|
||
|
public function after()
|
||
|
{
|
||
|
$response = Flight::response();
|
||
|
$response->write(str_replace('<span style="color:red; font-weight: bold;">failed</span>', '<span style="color:green; font-weight: bold;">successfully works!</span>', $response->getBody()), true);
|
||
|
}
|
||
|
}
|