男生(和女生
我想问你如何建立的形式(formbuilder)的Prestashop 1.7的当前2020年。
我创建的模块与类和钩子,但我不能找到的信息,如何通过 "类 "和 "控制器 "创建表格.我很高兴有这样的东西。
我很高兴能有这样的东西:
创建了自定义模块
自定义钩子
自定义.tpl从moduletemplatesfrontcustom.tpl被添加到钩子和正确显示数据。
使用表单生成器在您的。php文件(或控制器)。
return array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs',
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Live mode'),
'name' => 'TESTONE_LIVE_MODE',
'is_bool' => true,
'desc' => $this->l('Use this module in live mode'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-envelope"></i>',
'desc' => $this->l('Enter a valid email address'),
'name' => 'TESTONE_ACCOUNT_EMAIL',
'label' => $this->l('Email'),
),
array(
'type' => 'password',
'name' => 'TESTONE_ACCOUNT_PASSWORD',
'label' => $this->l('Password'),
),
),
'submit' => array(
'title' => $this->l('Save'),
),
),
);
}