我在drupal网站上工作,在调试时,我总是读通过长的嵌套数组。因此,我的生活的很大一部分花费在使用箭头,返回和选项卡键,将1000个字符串拆分成嵌套的,可读的格式。
对于drupal dev,我不能使用devel的dsm(),因为我使用多步#ahah /#ajax表单,我只能输出数组到错误日志,而不是屏幕。
视觉示例:
邪恶:
array ( 'form_wrapper' => array ( '#tree' => true, '#type' => 'fieldset', '#prefix' => '', '#suffix' => '', '#value' => '', 'name' => array ( '#type' => 'textfield', '#title' => NULL, '#size' => 60, '#maxlength' => 60, '#required' => false, '#description' => NULL, '#attributes' => array ( 'placeholder' => 'Email', ), '#post' => array ( 'form_wrapper' => array ( 'name' => '', 'pass' => '', ),
… …
好:
array (
'form_wrapper' => array (
'#tree' => true,
'#type' => 'fieldset',
'#prefix' => '
'#suffix' => '
'#value' => '',
'name' => array (
'#type' => 'textfield',
'#title' => NULL,
'#size' => 60,
'#maxlength' => 60,
'#required' => false,
'#description' => NULL,
'#attributes' => array (
'placeholder' => 'Email',
),
编辑:对不起,通过“不输出到屏幕”,我的意思是通过drupal的系统消息,可以以可点击的,嵌套格式(使用devel.module)输出数组。