[eluser]Perkin5[/eluser]
I have seen other posts relating to similar problems but none of them got an answer that works.
I am a beginner with codeigniter, using version 2.0.2 with php 5.3.
I am testing with a controller called start.php and the code is:
Code:
<?php
class Start extends CI_Controller
{
var $base;
function _construct()
{
parent::_construct();
$this->base = $this->config->item('base_url');
}
function hello()
{
$data['base'] = $this->base;
print_r ($data);
}
}
When I go to the hello function in the browser, the print_r function shows that $data is empty (like this: Array ( [base] => ) ). Why is the value set for $this->base in the constructor not available in the hello method? I have now spent about 8 hours on this one issue without success.