[eluser]Dr. Seuss[/eluser]
I feel extremely foolish, but here goes: I want to create custom array variables. I try:
Code:
$scripts['includes']=array('superfish','layout', 'admin');
$this->load->vars($scripts);
And then pass the variable to a view:
Code:
$this->load->view('common/header', $scripts);
In the view I have tried both
Quote:<?php
foreach ($scripts as $key => $val) {
echo "$key = $val\n";
}
?>
...and...
Quote:<?php
foreach ($scripts['includes'] as $key => $val) {
echo "$key = $val\n";
}
?>
In both cases, I get this error message:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: scripts
Filename: common/header.php
Line Number: 10
Just trying not to place everything within the "$data" array; I know that this must be possible and that I am missing something simple, but I cannot figure it out after two hours of flailing...any help would be appreciated.