[eluser]syntaxerror[/eluser]
hi,
i need help.
its my first time in using codeigniter.
i need a script that reads files in a folder into an array.
i think the directory helper can do it.
but i dont know how to use it.
in my controller
i made a function
Code:
function index()
{
$data['title'] = "DS Validator";
$data['header'] = "DS Validator";
$map = directory_map('C:/xampp/htdocs/AccmaRoster/', TRUE);
$this->load->view('front_view', $data);
}
and in my view
Code:
<?php foreach($map as $file): ?>
<li>
<ol><?php echo $file; ?></ol>
</li>
<?php endforeach; ?>
but there is an error
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: map
Filename: views/front_view.php
Line Number: 26
Code:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/front_view.php
Line Number: 29
please help
thanks