Forms Prestashop用户组';集团';自定义模块中的表单帮助器

Forms Prestashop用户组';集团';自定义模块中的表单帮助器,forms,prestashop,helper,form-helpers,Forms,Prestashop,Helper,Form Helpers,我想在from helper方法的模块中使用Customer group componnet(我在AdminPattern controller中找到它)。我可以将选中的复选框保存到配置表(我序列化了数组并将选项保存为文本),但无法将保存的值加载回表单 array( 'type' => 'group', 'label' => 'group', 'name'

我想在from helper方法的模块中使用Customer group componnet(我在AdminPattern controller中找到它)。我可以将选中的复选框保存到配置表(我序列化了数组并将选项保存为文本),但无法将保存的值加载回表单

    array(
                    'type' => 'group',
                    'label' => 'group',
                    'name' => 'configuration[]',
                    'values' => Group::getGroups(Context::getContext()->language->id),
                ),
在后处理中:

if (Tools::isSubmit('submitTallerOrden'))
    {
        $_POST['configuration'] = implode(',', Tools::getValue('configuration'));
    }
以渲染形式,我有:

$this->fields_value['configuration[]'] = explode(',',$obj->configuration);

像AdminCustomerController

形式:

            array(
                'type' => 'group',
                'label' => $this->l('Group access'),
                'name' => 'groupBox',
                'values' => Group::getGroups($this->default_form_language, true),
                'required' => true,
                'col' => '6',
                'hint' => $this->l('Select all the groups that you would like to apply to this customer.')
            ),
在渲染形式中:

foreach ($groups as $group) {
        $this->fields_value['groupBox_'.$group['id_group']] =
            Tools::getValue('groupBox_'.$group['id_group'], in_array($group['id_group'], $customer_groups_ids));
    }

像AdminCustomerController

形式:

            array(
                'type' => 'group',
                'label' => $this->l('Group access'),
                'name' => 'groupBox',
                'values' => Group::getGroups($this->default_form_language, true),
                'required' => true,
                'col' => '6',
                'hint' => $this->l('Select all the groups that you would like to apply to this customer.')
            ),
在渲染形式中:

foreach ($groups as $group) {
        $this->fields_value['groupBox_'.$group['id_group']] =
            Tools::getValue('groupBox_'.$group['id_group'], in_array($group['id_group'], $customer_groups_ids));
    }