Implementing a recursive menu system a'la Joomla in CodeIgniter
I have some sites powered by Joomla, but with my current assignment I wanted to try something new and created with CodeIgniter a really basic CMS (just to suit my client's needs). Everything works fine except menus - multilevel menus like in Joomla, Drupal etc. with items and subitems...
My question is: do you know of any tutorials or texts abut implementing such a structure. I've tried the recursion thinggy with while getting children's IDs move downwards from the parent while searching for the currently displayed item's ID. I've tried also the Drupalish way with having a path parameter enclosing ID's all the way from top to bottom '1/23/123/3'. But all in all it was just too chaotic - code something, try it out.
If you have some idea on this topic - tha开发者_运维问答nks in advice.
I'm going to to assume that your challenge is in the database part of it?
Storing and querying hierarchical data in a relational database is not really intuitive. I've once written an article with a few possible solutions, largely inspired by others:
Hierarchical data in MySQL: Easy and fast
精彩评论