在 Prestashop 模块中,我想显示一个选中的复选框。为此,我只是采用了这样的辅助类方法
$display_settings = array(
'form' => array(
'legend' => array(
'title' => $this->l( 'Display Settings' ),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'checkbox',
'name' => 'display',
'values' => array(
'query' => array(
array(
'id' => 'show_header',
'name' => $this->l('show header'),
'val' => '1',
'checked' => 'checked'
),
),
'id' => 'id',
'name' => 'name'
)
),
),
'submit' => array(
'title' => $this->l( 'Save Display Settings' ),
'class' => 'button pull-right',
'name' => 'save-main-display-settings',
)
),
);
但这个只显示checkbow(未选中)。我试图将 val 更改为 0,1。但这对我不起作用。那么有人可以告诉我如何在助手类中选中一个复选框。任何帮助或建议都将是非常可观的。谢谢