CodeIgniter Forums
Change output in post_system Event - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Change output in post_system Event (/thread-76498.html)



Change output in post_system Event - mickrus - 05-18-2020

In CI3 i used display_override - hook like this:
PHP Code:
function placeholders()
{
    
$CI =&get_instance();
    
$buffer $CI->output->get_output();
 
    
$buffer str_replace(array('{field1}','{field2}'), array('data1','data2'), $buffer);
 
    
$CI->output->set_output($buffer);
    
$CI->output->_display();
}
?>

How can I access from CI4 Event's (post_system) controller to output?


RE: Change output in post_system Event - includebeer - 05-18-2020

In CI4 you can achieve the same thing with an “after_filter”, see https://codeigniter4.github.io/userguide/incoming/filters.html#after-filters