经常在开发主题,或者模块的时候会使用到这个主题函数
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>
评论
发表新评论