I was a little embarrassed when I made my first post . This time I will be more specific.
I am trying to create a "filetree-like" table from an object ( from a php transfer project ). My table would have a file name, size and status (done or not). In "Name" we can see some line "full path to the file".
Thomas helped me create an array of names, but I forgot to tell him that I was trying to grab it from the object.
Here is an example of my code:
<?php $transmission = new Transmission(); $transfer= $transmission->get('26ec249e2669388ff359923702ac0f5c7687d1be'); $files = $transfer->getFiles(); foreach($files AS $file) { var_dump($file->getName());
Output:
string(59) "RootFolder/Folder1/File1.jpg" int(13324) bool(true) Transmission\Model\File Object ( [name:protected] => RootFolder/Folder1/File1.jpg [size:protected] => 13324 [completed:protected] => 13324 [client:protected] => )
$ will be output:
Array ( [0] => Transmission\Model\File Object ( [name:protected] => RootFolder/Folder1/File1.jpg [size:protected] => 13324 [completed:protected] => 13324 [client:protected] => ) [1] => Transmission\Model\File Object ( [name:protected] => RootFolder/Folder1/File2.mp3 [size:protected] => 10383488 [completed:protected] => 10383488 [client:protected] => ) [2] ... )
I saw a good job from www.abeautifulsite.net , but based on the is_dir() command.
What I want to do is an html table with folding parts (by folders) and file information (name, size and status) in the lines of the file.
Any ideas?
source share