container; $output = $container['output']; if ($output instanceof \Psr\Http\Message\ResponseInterface) { // Support for custom output providers like Slim Framework. } else { // Use internal Grav output. $container->output = $output; $container->fireEvent('onOutputGenerated'); // Set the header type $container->header(); echo $container->output; // remove any output $container->output = ''; $this->container->fireEvent('onOutputRendered'); } } }