CodeIgniter Forums
directory_map() not working returns bool(false) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: directory_map() not working returns bool(false) (/thread-64204.html)



directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

I have different image folders under 'Property gallery' directory e.g. 'Property gallery/pro_1'. Here I want to fetch full paths of all the images inside the specified folder. I used directory_map() but it doesn't return anything. 
My code is: 
Code:
$image_path = $row['image_path'];//stored in database as 'Property gallery/Ganesh Kripa/'
/*--get all images in directory--*/
$map = directory_map($image_path);
var_dump($map);
//print_r($map);
foreach ($map as $result)
{
       $get_result = $image_path.$result;
    array_push($img_array,$get_result);
}


 var_dump($map) returns bool(false) and then error at foreach loop i.e. '[font=Times New Roman]Invalid argument supplied for foreach()' [/font]occurs. 
I set to autoload the url, form, path and directory helpers and my base url is 
Code:
http://localhost:8081/SVN_propertybooking/branches/dev/Admin/
 
And under Admin directory there is [font=sans-serif]Property gallery folder .[/font]
[font=sans-serif]I'm new in codeigniter, any help will be appreciated.[/font]
[font=sans-serif]My folder structure is[/font]

[font=sans-serif][font=Monaco, Consolas, Courier, monospace]->Admin[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace]     -> application[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace]     -> assets[/font][/font][/font]
[font=sans-serif]          -> Property gallery[/font]
[font=sans-serif]              -> [font=Monaco, Consolas, Courier, monospace]Ganesh Kripa[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace]     [/font][font=Monaco, Consolas, Courier, monospace]-> [/font][font=Monaco, Consolas, Courier, monospace]system[/font][/font][/font][/font]


RE: directory_map() not working returns bool(false) - InsiteFX - 01-27-2016

If you look at the directory_map helper its path takes a ./ in front of the directory name.


RE: directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

I tried but still not working same error occurs. Please see my newly edited question, added folder structure.


RE: directory_map() not working returns bool(false) - InsiteFX - 01-27-2016

$map = directory_map('./'.$image_path);


RE: directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

its worked..! Thanks