[eluser]Dr. Seuss[/eluser]
Whew. Back on this; sorry for the delay...
I have tried numerous things, both in the view and controller; everything is returning the same error "Message: Undefined variable: scripts" or "Message: Undefined variable: includes"...
Code:
<?php
class Designmenu extends Controller {
var $scripts['includes']=array('superfish','layout', 'admin');
function __construct()
{
parent::Controller();
}
function index()
{
$this->load->model('siteignite/treejson');
$data['mnujson'] = $this->treejson->get_json();
if(strlen($data['mnujson'])>0){
$this->load->view('common/header', $scripts);
$this->load->view('common/menu', $data);
$this->load->view('siteignite/body');
$this->load->view('common/col2');
$this->load->view('common/col3');
$this->load->view('common/footer');
}
}
}?>
...and in the view...
Code:
<?php
echo var_dump($scripts['includes']);
foreach ($includes as $val) {
echo $val."\n";
}
?>
The resulting germane errors are:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: scripts
Filename: common/header.php
Line Number: 10
NULL
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: includes
Filename: common/header.php
Line Number: 12
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: common/header.php
Line Number: 12
Truly confusing.
BTW, I did try a variant of the "$scripts = $data" code, but that got the same result.