Answer the question
In order to leave comments, you need to log in
Codeigniter, 404 in controller?
I encountered unusual CI behavior when customizing a 404 error :(
I use a simple template library:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template {
var $template_data = array();
function set($name, $value)
{
$this->template_data[$name] = $value;
}
function load($template = '', $view = '' , $view_data = array(), $return = FALSE)
{
$this->CI =& get_instance();
$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
return $this->CI->load->view($template, $this->template_data, $return);
}
}
/* End of file Template.php */
/* Location: ./system/application/libraries/Template.php */
$this->template->load('template', 'error404');
$route['404_override'] = 'error404';
Message: Undefined property: Error404::$template
Filename: controllers/error404.php
$CI =& get_instance();
print_r($CI);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question