I am looking to create a table of content of sorts for my application like I have seen other doing but I have no idea what this called or what generates it. If anyone can help me figure this out I would be very greatful.

Example of code:

├── app/                  ← directory with application
│   ├── config/           ← configuration files
│   │   ├── config.dev    ← main config file
│   │   └── config.local 
│   │
│   ├── forms/            ← form classes
│   ├── model/            ← model layer and its classes
│   ├── presenters/       ← presenter classes
│   │   ├── HomepagePresenter.php  ← Homepage presenter class
│   │   └── templates/    ← templates directory
│   │       ├── @layout.latte ← template of shared layout
│   │       └── Homepage/     ← templates for Homepage presenter
│   │           └── default.latte  ← template for default action
│   ├── router/           ← router classes
│   │
│   └── bootstrap.php     ← application boot file
├── log/                  ← contains logs, errors, etc.
├── temp/                 ← for temporary files, cache, ...
├── vendor/               ← directory with libraries (for example 3rd party)
│   ├── name/             ← all Name Framework libraries
│   │   └── name/name     ← Name Framework itself installed by Composer
│   ├── ...
│   │
│   └── autoload.php      ← script that handles autoloading of all classes from installed packages
└── www/                  ← public directory, document root of project
    ├── .htaccess         ← rules for mod_rewrite
    ├── index.php         ← triggers the application
    └── images/           ← other directories, images, styles, ..
  • 2
    That type of list is generally called a treeview or a treelistview. Are you asking how to create it too or just the name? – Eric F Mar 31 '16 at 17:38
  • Both actually, I am building a app and need a way to display all the parts of what is being built. Is there a MVC PHP composer type package that you know of that will do this. Thank you for help identifying what it is so I can look for one or start building my own. if you are aware of any that would be cool. – user3303891 Mar 31 '16 at 17:54

That is a TreeListView. It contains a TreeView on the left side, and then an attached ListView on the left with one or more columns for showing data about each leaf or node in the TreeView.


The control you are talking about is often called a TreeView or TreeListView (depending on the programming language). Here is a good example of creating one in PHP:


enter image description here

In any case, you can't directly make the TreeView in PHP. You can however as shown above, make it using a CSS style file.

  • Thank you for your response. I am working in a few different frameworks but they are all tied to the MVC at the moment im in laravel and im looking to output this as a type of markdown reference so really do not need any style or css just the output of the simple line version above. I do on the other hand need that type also sometimes so I am already checking out what you sent me. Thank you. – user3303891 Mar 31 '16 at 18:36
  • @user3303891 Either way, you can't do this with JUST PHP. If it does help please mark as an answer. If not, ask and I will try to help more. – Eric F Mar 31 '16 at 18:38
  • Probably stackoverflow is more appropriate site if it's related to actual programming – Techie Mar 31 '16 at 18:50
  • 1
    @Nimesh His original question of what it is called is appropriate for SU. The second follow up question, I agree should be on SO. – Eric F Mar 31 '16 at 19:05
  • Right, that's what I meant. – Techie Mar 31 '16 at 19:11

OK, I have found a way to get this started.

Install with sudo apt-get install tree.

Route::get('/tree', function () {
    $process = new Process('tree -CHhd database');
    try {
        echo $process->getOutput();
    } catch (ProcessFailedException $e) {
        echo $e->getMessage();

This still needs some tweaking, but thank all of you for the help getting me started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.