I've no idea what you're using for the themes, but from what I see:
$this->config->item('config_template') . '/template/common/welcome_message';
This line makes absolutely no sense. It's the same if you just write
'something/template/common/welcome_message';
I'm pretty sure you want to do this instead:
$this->load->view($this->config->item('config_template') .'/template/common/welcome_message', $data);
file_exists(APPPATH . $this->config->item('config_template') . '/template/common/welcome_message', $data)
Here you have 1 redundant parameter. As the error says, file_exists()
accepts 1 argument, and you have 2 (the second is $data
) - remove it and the error should go away. I guess you wanted to put it in the next line inside $this->load->view
Edit: And to be clear, here's the complete code you should use.
public function index() {
$data['header'] = $this->load->view($this->config->item('config_template') . '/template/common/header', NULL, TRUE);
$data['footer'] = $this->load->view($this->config->item('config_template') . '/template/common/footer', NULL, TRUE);
if (file_exists(APPPATH . $this->config->item('config_template') . '/template/common/welcome_message')) {
$this->load->view($this->config->item('config_template') . '/template/common/welcome_message', $data);
} else {
$this->load->view('default/template/common/welcome_message', $data);
}
}