Welcome Guest, Not a member yet? Register   Sign In
How to extending/modify the Profiler?
#4

[eluser]kaejiavo[/eluser]
[quote author="altrano" date="1287952819"]

Thanks what is the different between 2.0 1.7.2 for this modifications?
Not anyone have this do with 1.7.2 ??[/quote]

In 1.7.2 you have to overwrite the run() function like this:
Code:
class MY_Profiler extends CI_Profiler {

    /**
     * Adds mysection data to the profiler
     */
    public function _compile_mysection() {

    $output = ...
    return $output;
    }

    /**
     * Adds session data to the profiler
     */
    function _compile_session() {
    // same code as in example above
    $output = ...
    return $output;
    }

    // overwrite run()
    function run() {
    $output = "<div id='codeigniter_profiler' style='clear:both;background-color:#fff;padding:10px;'>";

    $output .= $this->_compile_uri_string();
    $output .= $this->_compile_controller_info();
    $output .= $this->_compile_memory_usage();
    $output .= $this->_compile_benchmarks();
    $output .= $this->_compile_get();
    $output .= $this->_compile_post();
    $output .= $this->_compile_queries();
    // add your sections here
    $output .= $this->_compile_mysection();
    $output .= $this->_compile_session();

    $output .= '</div>';

    return $output;
    }

Marco


Messages In This Thread
How to extending/modify the Profiler? - by El Forum - 10-23-2010, 09:13 PM
How to extending/modify the Profiler? - by El Forum - 10-24-2010, 01:57 AM
How to extending/modify the Profiler? - by El Forum - 10-24-2010, 09:40 AM
How to extending/modify the Profiler? - by El Forum - 10-24-2010, 10:52 AM
How to extending/modify the Profiler? - by El Forum - 10-24-2010, 01:05 PM
How to extending/modify the Profiler? - by El Forum - 10-24-2010, 01:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB