CodeIgniter Forums
Profiler no longer displays after use of a layout hook - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Profiler no longer displays after use of a layout hook (/showthread.php?tid=917)



Profiler no longer displays after use of a layout hook - Devildog - 01-29-2015

I've just set up a layout hook to streamline some of my own work, however, I've just realized my profiler has disappeared. I'm not quite sure what I need to do to get it back.

If I set
Code:
$config['enable_hooks'] = FALSE
profiler re-appears, but breaks my layout of course. I'm assuming I've got to add a bit to my hook class, but I'm not sure where or what at this point.

PHP Code:
class Layout {
 
   public function index()
 
   {
 
       $CI =& get_instance();

 
       $current_output $CI->output->get_output();

 
       if ($CI->uri->segment(1) == 'admin')
 
           $layout_file APPPATH 'views/admin/layout.php';
 
       else
            $layout_file 
APPPATH 'views/frontend/layout.php';
 
       $layout $CI->load->file($layout_filetrue);
 
       $mod_output str_replace("{yield}"$current_output$layout);

 
       //echo $layout_file;
 
       echo $mod_output;
 
   }


And of course, I've set
PHP Code:
$this->output->enable_profiler(TRUE); 
in my Controller.

Any suggestions or help would b greatly appreciated!