I'm displaying a form on admin url :admin/settings/custom
. In the page argument I pass array('custom_admin_form'),
to the menu item. In the form function I'm writing form elements to display folder and file names present in the public folder. I get those values through the code below:
$dir_path = variable_get('file_public_path', conf_path(). '/files') ;
$fileslist = glob($dir_path . "*.*");
$dirs = glob($dir_path . '/*' , GLOB_ONLYDIR);
foreach($dirs as $directs){
$names = explode('/', $directs);
$fnames[] = end($names);
}
How can I display the results in the form function? I tried it using print
, echo
, drupal_render
but nothing is working. I've also used #markup
element, but it was displaying array()
, not the values of array.