jeudi 29 octobre 2015

Create menu from self referencing table

I didn't set the model for this table. But i would like to know how to process it in the view. Do I have to create a model for it to maintain it?

how will it looks like

here is the structure of table

Categories
    id 
    parent_category
    title

and the end result would be like this

<ul>
   <li>ACME Products Inc.</li>
   <ul class=”children”>
       <li>Acme Accounting Solutions</li>
       <li>Acme Reseach & Development
   <ul>
   <li>Acme Prototypes Limited</li>
</ul>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire