Drupal 7 自定义表单无法将字符串偏移量用作 php 7.2 的数组错误
Drupal 7 custom form Cannot use string offset as an array error with php 7.2
我有一个自定义的 drupal 7 表单,如下所示
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....
我在“$form['general_details']['salutation']”行中收到错误错误:无法将字符串偏移量用作数组 PHP7.2
有人可以帮忙吗?
提前致谢。
你必须在赋值之前声明空数组
$form = array();
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....
我有一个自定义的 drupal 7 表单,如下所示
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....
我在“$form['general_details']['salutation']”行中收到错误错误:无法将字符串偏移量用作数组 PHP7.2
有人可以帮忙吗? 提前致谢。
你必须在赋值之前声明空数组
$form = array();
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....