Welcome Guest, Not a member yet? Register   Sign In
$hook['display_override'] but not profiling and benchmark
#1

[eluser]bas_vdl[/eluser]
Hi there,

i'm using the Yielder hook wich include your view into a default layout file. but when i use the profiling option and the hook is enable i dont see the profiling results.

can someone help me edit the hook so i can use the hook and profiling at the same time?

(I think the hook is overriding the benchmark and profiling data)

Yielder Hook:
http://hasin.wordpress.com/2007/03/05/ad...deigniter/
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Yielder {
    function yield() {
        $ci = & get_instance ();
        $current_output = $ci->output->get_output ();

        $layout = APPPATH . 'views/layout/default.php';

        if (file_exists ( $layout ))
        {
            $output = $ci->load->file ( $layout, true );
            $output = str_replace ( '{content}', $current_output, $output );
        }
        else
        {
            $output = $current_output;
        }

        echo $output;
    }
}

CI Hook config
Code:
$hook['display_override'][] = array(
    'class' => 'Yielder',
    'function' => 'yield',
    'filename' => 'Yielder.php',
    'filepath' => 'hooks'
);
#2

[eluser]bas_vdl[/eluser]
When i use this... then the profilling work but the layout file wil not be loaded

Code:
$hook['post_controller'] = array(
    'class' => 'Yielder',
    'function' => 'yield',
    'filename' => 'Yielder.php',
    'filepath' => 'hooks'
);

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Yielder {
    function yield() {
        $ci = & get_instance ();
        $current_output = $ci->output->get_output ();

        $layout = APPPATH . 'views/layout/default.php';

        if (file_exists ( $layout ))
        {
            $output = $ci->load->file ( $layout, true );
            $output = str_replace ( '{content}', $current_output, $output );
        }
        else
        {
            $output = $current_output;
        }

        return $output;
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB