Mickie D
04-26-2015, 06:03 PM
hi there,
I am having trouble with the outputting of an array
Basically I am trying to show the contents of a directory on a custom page. I have created the template and also registered the variable but it will only show me the first row and not the rest.
$dir = "/uploaddirectory/";
$exclude = array( ".","..","error_log","_notes" );
if (is_dir($dir)) {
$files = scandir($dir);
foreach($files as $file){
if(!in_array($file,$exclude)){
$filerows = '<li>' . $file . '</li>';
}
}
}
// ###### Register Variables #######
vB_Template::preRegister('mytemplate',array('filer ows' => $filerows));
There are 4 files in that folder and all that it will display for me is the first one?
Thank you so much for any help you can give me
I am having trouble with the outputting of an array
Basically I am trying to show the contents of a directory on a custom page. I have created the template and also registered the variable but it will only show me the first row and not the rest.
$dir = "/uploaddirectory/";
$exclude = array( ".","..","error_log","_notes" );
if (is_dir($dir)) {
$files = scandir($dir);
foreach($files as $file){
if(!in_array($file,$exclude)){
$filerows = '<li>' . $file . '</li>';
}
}
}
// ###### Register Variables #######
vB_Template::preRegister('mytemplate',array('filer ows' => $filerows));
There are 4 files in that folder and all that it will display for me is the first one?
Thank you so much for any help you can give me