Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Install Issue I Cannot solve
#1

[eluser]bknox360edu[/eluser]
I am getting this error:

Fatal error: Call to undefined method CI_Loader::template() in /var/CI/CI_application/controllers/content.php on line 51

When running a codeigniter install on a linux server with PHP Version 5.3.3-7+squeeze14 debian.

I don't get the error when I am running it on WAMP with Win7 64-Bit PHP Version 5.4.3.

CodeIgniter is version 2.1.3.

That particular function is in the application/MY_Loader.php in the core directory which properly is extending CI_Loader.

Any ideas why this might be happening?
#2

[eluser]painkiller[/eluser]
What do u have in /var/CI/CI_application/controllers/content.php on line 51 ?
#3

[eluser]bknox360edu[/eluser]
Code:
public function index($linkname = 'home')
{
            
            $this->data->content = $this->website->get_page($this->websiteid,$linkname);
            
            $this->load->template('content', $this->data);
            
}

$this->load->template('content',$this->data); is line 51

Is there anything else I might need to post?

it's just a controller function and the MY_Loader class looks like this:

Code:
<?php

/**
* /application/core/MY_Loader.php
*
*/
class MY_Loader extends CI_Loader {
    public function template($template_name, $vars = array(), $return = FALSE)
    {
        $navigation = $this->view('templates/navigation',$vars,TRUE);
        
        if(is_array($vars)){
            $vars['navigation'] = $navigation;
        }else{
            $vars->navigation = $navigation;
        }
        
        $content  = $this->view('templates/header', $vars, $return);
        $content .= $this->view($template_name, $vars, $return);
        $content .= $this->view('templates/footer', $vars, $return);

        if ($return)
        {
            return $content;
        }
    }
}
#4

[eluser]bknox360edu[/eluser]
Can anyone help me solve this one?
#5

[eluser]bknox360edu[/eluser]
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: mimes

Filename: core/Output.php

Line Number: 107


This was another error I got recently


-------------

Fatal error: Call to undefined method MY_Loader::template() in C:\wamp\www\Root\var\CI\CI_application\controllers\programs.php on line 106


On my localhost when I remove the function I get this error, notice the difference MY_Loader, and CI_Loader. The Core MY_Loader doesn't seem to be loading, any help?
-------------
That seems to make sense, I added the function to system CI_Loader.php class and if worked, any idea how I can get CodeIgniter to load MY_Loader?
#6

[eluser]Aken[/eluser]
What is the exact file name of your MY_Loader.php? My guess is you have a case sensitivity issue, and it is not finding your MY_Loader file. The name should typically match the class name exactly (MY_Loader.php), but some file systems may require all lowercase.
#7

[eluser]Unknown[/eluser]
Thanks Aken for that reminder ! I had the same error...

[quote author="Aken" date="1363654356"]What is the exact file name of your MY_Loader.php? My guess is you have a case sensitivity issue, and it is not finding your MY_Loader file. The name should typically match the class name exactly (MY_Loader.php), but some file systems may require all lowercase.[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB