Welcome Guest, Not a member yet? Register   Sign In
Indirect modification of overloaded property Template::$CI has no effect
#1

[eluser]johnmerlino[/eluser]
Hey all,

I'm getting this error:

A PHP Error was encountered

Severity: Notice

Message: Indirect modification of overloaded property Template::$CI has no effect

Filename: libraries/Template.php

Line Number: 50

Fatal error: Cannot assign by reference to overloaded object

Basically in the Template library, which is autoloaded, I have a method called render_content:

Code:
function render_content($template = '', $view = '' , $data = array(), $return = FALSE){              
        $this->CI =& get_instance();
        
        $this->title = "Default Title";
        $this->subtitle = "Default Subtitle";
        
        $this->_data = array_merge($this->_data, $data);
        
        $this->set('yield', $this->CI->load->view($view, $_data, TRUE));            
        return $this->CI->load->view($template, $this->template_data, $return);
    }

Basically, it sets a default title and subtitle and stores it into $_data array:

Code:
public function __set($name, $value){
        $this->_data[$name] = $value;
    }

Then in controller I set some variables that override the defaults in Template:

Code:
public function signup(){
            
            $this->template->render_content('template', '/users/signup', array('title' => 'Signup Form', 'subtitle' => 'Free Case Evaluation'));

I think it has something to do with __set method, which overloads. But I don't know what else to do.

Thanks for response.


Messages In This Thread
Indirect modification of overloaded property Template::$CI has no effect - by El Forum - 02-27-2011, 02:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB