跳转到主要内容
a136249692 提交于 4 November 2014

请教下D8里用ajax生成了一个表单,我print_r($form_state); 但是没有生成表单的值。我应该怎么才能取到值呢?

Drupal 版本

用了dpm($form_state);后有显示ajax生成的表单信息,

'etl_format_check' => array(3)
    'erj_name' => array(3)

        '#type' => string(9) "textfield"

        '#title' => string UTF-8(2) "表名"

        '#value' => string(3) "erw"
   
    'fields_type_0' => array(3)

        '#type' => string(6) "select"

        '#title' => string UTF-8(4) "字符类型"
        '#options' => array(3)

            string UTF-8(3) "字符串"

            string UTF-8(2) "数值"

            string UTF-8(2) "日期"

 

然后我用$form_state->getValue(array('etl_format_check','erj_name'),'m');取值确定取不到值:)?