Welcome Guest, Not a member yet? Register   Sign In
link to files found using directory_map
#1

[eluser]scottelundgren[/eluser]
I'm curious if I'm not seeing an easier way to accomplish this task with CI:

I have a tree of files in various levels of sub directories I want to make downloadable to the user. I want to present the directory structure in an unordered list so that I may set a css class type per list item that corresponds to the file's MIME type.

While using directory_map of the Directory Helper will return an array of arrays of the directories & files and I can pass that array to ul() function of the HTML helper ul() only sets properties at the ul level not at the list item level.

is there an easy way to extend or override the ul() function in core CI?
Right now it looks like my best bet is to copy and paste the core CI ul() function into my controller and tweak it in the controller.

Since i want to make the files a downloadable link It seems I can't take the array of arrays returned by directory_map () and pass them to URL Helper's anchor() because anchor() is expecting a string of the path to the file. Or am I missing something?

The application's root directory has:

- application (my CI code)
- system (CI core)
- downloads (downloadable files)




Theme © iAndrew 2016 - Forum software by © MyBB