title: How to use the CakePHP function called generatetreelist?
body: <p>I am new to CakePHP and this function so please help me as you can.</p>
  
  <pre><code>generatetreelist(null, null,'{n}.Category.name', '&amp;nbsp;&amp;nbsp;-&amp;nbsp;');
  </code></pre>
  
  <p>this shows categories name and childrens perfect but I want to show my all fields of my categories in my <code>index.ctp</code>. For example name(already showing), status.
  if you could solve my problem? please do it...
  in my view I used: </p>
  
  <pre><code>foreach($categories as $key=&gt;$value) {
  
     echo $value;//it shows just name..
  
  }
  </code></pre>
  
  <p>in my controller:</p>
  
  <pre><code>$nCategories = $this-&gt;Category-&gt;generatetreelist(null, '{n}.Category.id','{n}.Category.name', '&amp;nbsp;&amp;nbsp;-&amp;nbsp;');
                      $this-&gt;set(compact('nCategories',$this-&gt;paginate('Category'))); 
  </code></pre>