Welcome Guest, Not a member yet? Register   Sign In
CI_Loader extend causing headers error
#1

[eluser]orzilca[/eluser]
Hello everybody,

I've came across something that drives me crazy. please help me Sad

I'm try to extend the CI_Loader Core in-order to create global header and footer.
For some reason, the extending causes error.

The extend code
Code:
class MY_Loader extends CI_Loader
    {

        function __construct()
        {
            // i need the codeigniter super-object
            // in all the function
        }

        public function load_header()
        {
            echo 'header';
        }
        
        public function load_footer()
        {
            echo 'footer';
        }
        
    }

The error i currently get
Code:
Unable to load the requested file: helpers/url_helper.php
#2

[eluser]orzilca[/eluser]
Ignore the topic, its not acurate.
Yesterday i had some headers error with the same code.. now its the current error

what am i doing wrong?
#3

[eluser]orzilca[/eluser]
Update
Changed the code and got the header error again

Code:
class MY_Loader extends CI_Loader
    {

        function __construct() {
            parent::__construct();
    
            $CI =& get_instance();
            $CI->load = $this;
        }

        public function load_header()
        {
            echo 'header';
        }
        
        public function load_footer()
        {
            echo 'footer';
        }
        
    }

Error
Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /mounted-storage/home75b/sub007/sc43190-SREL/gogetmilk.com/application/core/MY_Loader.php:1)

Filename: libraries/Session.php

Line Number: 672

I haven't changed anything in codeigniter's core
its a brand new version from yesterday, just created my_loader




Theme © iAndrew 2016 - Forum software by © MyBB