
michael andersen - 2011-02-02 23:29:38
Hi there
This promises to be a very useful bit of code!
Perhaps I should be calling your class a different way?
Rather than closing a parent's <li> with an </li> how can one inject the children's <ul> and <li> into the parent's own <li>?
I'm a bit confused about the HTML that is produced by the demo...
As is, the test.php yields;
<ul>
<li>Cat 6</li>
<li>
<ul>
<li>Cat 1</li>
<li>
<ul>
<li>Cat 2</li>
<li>Cat 3</li>
<li>
<ul>
<li>Cat 4</li>
</ul>
</li>
</ul>
</li>
<li>Cat 8</li>
</ul>
</li>
----snip----
But as I understand how nested lists work, should you not be producing HTML like the following?
<ul>
<li>Cat 6
<ul>
<li>Cat 1
<ul>
<li>Cat 2</li>
<li>Cat 3
<ul>
<li>Cat 4</li>
</ul>
</li>
</ul>
</li>
<li>Cat 8</li>
</ul>
</li>
---------------------------------
Maby I'm missing something here in how to use this class?
Michael