Fixed bug causing a header warning.
By default, FuzeWorks\Layout doesn't redirect it's display output to FuzeWorks\Output. If this is desired behaviour the layoutDisplayEvent needs to be interrupted. This eventListener was not implemented, resulting in FuzeWorks\Layout::display output not being redirected. This patch fixes that.
This commit is contained in:
parent
0ba98f8130
commit
74cb630d80
|
@ -37,6 +37,7 @@
|
|||
namespace FuzeWorks;
|
||||
|
||||
use FuzeWorks\Event\HaltExecutionEvent;
|
||||
use FuzeWorks\Event\LayoutDisplayEvent;
|
||||
use FuzeWorks\Event\LayoutLoadEvent;
|
||||
use FuzeWorks\Event\RouterCallViewEvent;
|
||||
use FuzeWorks\Event\RouterLoadViewAndControllerEvent;
|
||||
|
@ -158,6 +159,15 @@ class WebComponent implements iComponent
|
|||
return $event;
|
||||
}, 'coreShutdownEvent', Priority::NORMAL);
|
||||
|
||||
// Intercept output of Layout and redirect it to Output
|
||||
Events::addListener(function($event){
|
||||
/** @var $event LayoutDisplayEvent */
|
||||
/** @var Output $output */
|
||||
$output = Factory::getInstance('output');
|
||||
$output->appendOutput($event->contents);
|
||||
$event->setCancelled(true);
|
||||
}, 'layoutDisplayEvent', Priority::NORMAL);
|
||||
|
||||
// Add HTTP method prefix to requests to views
|
||||
Events::addListener(function($event){
|
||||
/** @var Input $input */
|
||||
|
|
Loading…
Reference in New Issue