Recently asked infinite classification of tree-like problems more, so a happy to write a, I just finished, we use to see, see how to achieve faster, simpler, put your tree also posted out (to query only once database) <br>
This is a categorized list of class trees that support infinite classification <br>
A category can have both "categories that contain subclasses" and "final Classification";<br>
The only advantage is * * * * * * * * only need to do a database * * * Query .<br>
Not very good-looking, but you can customize the changes, you can define your own CSS plus inside <br>
The cache has not been done, you can make up your own
The directory structure of the following example is this.
¦--catagory.php <br>
¦--images----tree.jsp <br>
¦--images----Treeopen.gif <br>
¦--images----Treeclose.gif <br>
¦--images----Line.gif <br>
Class catagory{
Basic classification data
var $treeData = array ();
The hierarchical array of classifications, with the ID value of the category as the keyword for the array
var $treePList = array ();
The relationship of self-classification corresponding to superior class
var $treeCList = array ();
/*
* This is a template for large categories
*
* Number of __id__ categories
* Name of the __name__ category
* __image__ Category The image name shown earlier $imgOpen or $imgClose
* Whether the __OPEN__ classification is currently expanded
* __inner__ the position displayed by the sub category
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.