You are here

drupal表单元素: Item(项目)

 

项目元素的格式与其它输入表单元素的相同,比如文本字段或下拉选择框字段,但是它缺少输入框。
 
$form['removed'] = array(
    '#title' => t('Shoe size'),
    '#type' => 'item',
    '#description' => t('This question has been removed because the law prohibits       us from asking your shoe size.'),
);
 
前面元素的呈现结果如图10-17所示。
 
10-17 项目元素
 
       项目元素的常用属性如下:#attributes, #description, #prefix(默认为空字符串''), #required, #suffix (默认为空字符串''),#title, #value,和 #weight.

老葛的Drupal培训班 Think in Drupal

Drupal版本: