Undefined property: MY_Config::$item |
[eluser]CARP[/eluser]
Hi I'm getting this strange error while working on my application 1- I've created a new config file which contains only this Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 2- I've put this file in application/config and put in autoload 3- I echo the value inside a view (for testing) and works Code: echo $this->config->item('dir_views'); 4- The problem: I have a main_view.php I load a second_view.php from within main_view And... If I do again the echo of dir_views config item inside second_view Code: <h1>Second_view</h1> I get this Click to see image
[eluser]stuffradio[/eluser]
Why are you getting an instance of CI inside a view? It already has it. Just go Code: echo $this->config->item('dir_views');
[eluser]CARP[/eluser]
damn. I don't remember if I tried that before or not, but now it is working |
Welcome Guest, Not a member yet? Register Sign In |