[eluser]dimis[/eluser]
I have this problem.
I have a controler and at constructor I set the view of the header
Code:
$this->data['header'] = $this->load->view('main/header', $this->data, TRUE);
At my function addcart I set
Code:
$this->data['myjs']="include js file";
And I write at header view
Code:
<?php echo $myjs ?>
But view do not print this variable .
What is wrong?
Maybe I have to initialize $this->data['myjs'] before header view but I want this script only at this function.
Is there a solution to write it at header?