Welcome Guest, Not a member yet? Register   Sign In
help on directory helper
#1

[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>&lt;?php echo $file; ?&gt;</ol>
            </li>
&lt;?php endforeach; ?&gt;

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


Messages In This Thread
help on directory helper - by El Forum - 10-06-2008, 04:22 AM
help on directory helper - by El Forum - 10-06-2008, 04:23 AM
help on directory helper - by El Forum - 10-06-2008, 04:35 AM
help on directory helper - by El Forum - 10-06-2008, 04:36 AM
help on directory helper - by El Forum - 10-06-2008, 04:40 AM
help on directory helper - by El Forum - 10-06-2008, 05:03 AM
help on directory helper - by El Forum - 10-06-2008, 05:10 AM
help on directory helper - by El Forum - 10-06-2008, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB