继续Drupal分享精神 QQ群:107748121 站长QQ:2275288328 skype: hellodrupal【drupal交流+drupal 建站+theme制作】
登录 注册

Drupal theme_item_list theme主题函数

经常在开发主题,或者模块的时候会使用到这个主题函数
theme_item_list ( $ items = array(),
$ title = NULL,
$ type = 'ul',
$ attributes = NULL
)

返回一个列表项目,就如表格一样的定义比表.

参数:
$items 显示在列表里面的一个列项目数组数据. If an item is a string, then it is used as is. If an item is an array, then the "data" element of the array is used as the contents of the list item. If an item is an array with a "children" element, those children are displayed in a nested list. All other elements are treated as attributes of the list item element.
$title 列表标题变量
$attributes The attributes applied to the list element.
$type 表单类型 (e.g. "ul", "ol")

例如:

<?php

$items
= array();//可以给数组$items赋值。
theme('item_list'$items, 'drupal 主题相关信息');
?>

输出结果样式:
<div class="item-list">
<h3>'drupal 主题相关信息'</h3>
<ul>
<li class="first"><a href="/9.html">最新drupal主题</a></li>
<li class="last"><a href="/8.html">主题设计新想法</a></li>
</ul>
</div>

评论

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.