This is what I have:
class Calendar extends CI_Controller {
public $extension;
function __construct()
{
parent::__construct();
$this->extension = "";
}
public function index($page_id, $extension=null)
{
if(!is_null($extension))
{
$this->extension = $extension;
}
$this->firephp->log($this->extension);
$this->load->view('/modules/calendar_view', array("page_id" => $page_id, "extension" => $this->extension));
}
public function update_calendar($width, $page_id, $new_month=null, $new_year=null)
{
$this->firephp->log($this->extension);
}
}
The correct value echos out in the index method fine, obviously. But the view it loads then calls the second method and the global variable is not set.
Is there a way of setting it until it’s explicitly changed?
Thanks.
public $extensionis not a global variable here. I believe flashdata is what you are looking forIn your next call you can get the item as
These are flushed in next execution.