-
通过print_r或dsm(DEVEL模块)调查$ form_state结构,并在mywebform_extra_submit_44
函数中找到您提交的数据。
function mymodule_webform_submission_insert($node, $submission)
{
$value = array_shift($submission->data);
$value = array_shift($value['value']);
//$value is now the first value entered (in the case of multi-entry fields) or only value entered
}
节点和提交是stdclass对象。 (在Drupal 6中完成)
将其放在我的自定义模块的顶部
use Drupal\webform\Entity\WebformSubmission;
我的控制器构建功能:
$sub = WebformSubmission::load(2036); //need a submission id
$data = $sub->getData();
现在您将数据包含在数组中。
更多信息: