【发布时间】:2009-05-08 22:54:15
【问题描述】:
我在这段代码上遇到 T_String 错误,它在第二行 ($form['com...) 上说得更准确,我根本不明白为什么。
function _maxlength_comment_type_form_alter(&$form, $form_state, $form_id) {
$form['comment']['comment_max_length'] = array(
'#type' => 'select',
'#title' => t('Maximum comment length'),
'#default_value' => variable_get('comment_max_length_'. $form['#node_type'] -> type, 160),
'#options'=> drupal_map_assoc(array(140,160,180,200)),
'#description' => t('numero maximo de caracteres permitidos.'),
'#weight' => -1,
);
我将此代码添加到 Maxlength drupal 模块中。
【问题讨论】:
-
您所写的是语法正确的 PHP 代码。如果我用 包装它,它在 PHP4 和 PHP5 中都没有语法错误。