+ -
当前位置:首页 → 问答吧 → 求助,这样的一棵树在模板中怎么输出?

求助,这样的一棵树在模板中怎么输出?

时间:2011-04-27

来源:互联网

这样的一棵树再模板中怎么输出,无限级分类,深度不知。
  1. Array
  2. (
  3.     [0] => Array
  4.         (
  5.             [0] => news
  6.             [1] => Array
  7.                 (
  8.                     [id] => 1
  9.                     [lang] => cn
  10.                     [module] => news
  11.                     [parent_id] => 0
  12.                     [title] => 动态新闻
  13.                     [description] => 动态
  14.                     [sort] => 0
  15.                     [create_at] => 0
  16.                     [update_at] => 0
  17.                     [_child] => Array
  18.                         (
  19.                             [0] => Array
  20.                                 (
  21.                                     [id] => 6
  22.                                     [lang] => cn
  23.                                     [module] => news
  24.                                     [parent_id] => 1
  25.                                     [title] => 内部新闻
  26.                                     [description] =>
  27.                                     [sort] => 0
  28.                                     [create_at] => 0
  29.                                     [update_at] =>
  30.                                 )

  31.                         )

  32.                 )

  33.             [2] => Array
  34.                 (
  35.                     [id] => 4
  36.                     [lang] => cn
  37.                     [module] => news
  38.                     [parent_id] => 0
  39.                     [title] => <a>a</a>
  40.                     [description] =>
  41.                     [sort] => 0
  42.                     [create_at] => 1303815272
  43.                     [update_at] =>
  44.                 )

  45.             [3] => Array
  46.                 (
  47.                     [id] => 5
  48.                     [lang] => cn
  49.                     [module] => news
  50.                     [parent_id] => 0
  51.                     [title] => <font color="red">行业新闻</font>
  52.                     [description] =>
  53.                     [sort] => 0
  54.                     [create_at] => 1303815362
  55.                     [update_at] =>
  56.                 )

  57.             [4] => Array
  58.                 (
  59.                     [id] => 7
  60.                     [lang] => cn
  61.                     [module] => news
  62.                     [parent_id] => 0
  63.                     [title] => 红红
  64.                     [description] =>
  65.                     [sort] => 0
  66.                     [create_at] => 1303877608
  67.                     [update_at] =>
  68.                 )

  69.         )

  70.     [1] => Array
  71.         (
  72.             [0] => product
  73.             [1] => Array
  74.                 (
  75.                     [id] => 2
  76.                     [lang] => cn
  77.                     [module] => product
  78.                     [parent_id] => 0
  79.                     [title] => 家居木材
  80.                     [description] => 家居
  81.                     [sort] => 0
  82.                     [create_at] => 1303810556
  83.                     [update_at] => 1303810556
  84.                 )

  85.         )

  86.     [2] => Array
  87.         (
  88.             [0] => download
  89.             [1] => Array
  90.                 (
  91.                     [id] => 3
  92.                     [lang] => cn
  93.                     [module] => download
  94.                     [parent_id] => 0
  95.                     [title] =>
  96.                     [description] => 软件
  97.                     [sort] => 0
  98.                     [create_at] => 1303812562
  99.                     [update_at] =>
  100.                 )

  101.         )

  102. )
复制代码

作者: nbczw8750   发布时间: 2011-04-27

这种多级分类只能用递归法显示了……

作者: zys4416   发布时间: 2011-04-27