我想在我的PrestaShop模塊的配置頁面上添加範圍滑塊。我試圖用HelperForm類來做到這一點,但我不能做到這一點,如果我寫了其他類型,例如'textarea'或'checkbox',它可以正常工作,即使沒有真正的標準輸入類型,如'顏色',但'範圍'不起作用如何將jquery ui滑塊添加到PrestaShop模塊表單
<?php
if (!defined('_PS_VERSION_'))
exit;
class icropper extends Module
{
public function __construct()
{
$this->name = 'icropper';
$this->tab = 'front_office_features';
$this->version = '1.0';
$this->author = 'AppDev';
$this->need_instance = 1;
$this->ps_versions_compliancy = array('min' => '1.5', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = $this->l('icropper');
$this->description = $this->l('Module for Cropping Images');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
if (!Configuration::get('MYMODULE_NAME'))
$this->warning = $this->l('No name provided');
}
public function install()
{
$filename = _PS_ROOT_DIR_.'/override/cropp.php';
$ext = get_loaded_extensions();
foreach($ext as $i)
{
if($i == "imagick") {
$imgck = $i;
break;
}
}
if (!parent::install()) {
return false;
} elseif (!$imgck) {
$this->context->controller->errors[] = $this->l('In your server does not installed Imagick library');
return false;
} elseif(file_exists($filename)) {
$this->context->controller->errors[] = $this->l('File that override cropping
already exist, please delete it and replace file by yourself');
return false;
}else {
//copy(__DIR__ . '/override/list_footer.tpl', _PS_ROOT_DIR_ . '/override/helpers/admin/templates/list');
return true;
}
}
public function uninstall()
{
if (!parent::uninstall())
return false;
return true;
}
public function getContent()
{
return $this->DisplayForm();
}
public function displayForm(){
$fields_formm[0] = array(
'form' => array(
'legend' => array(
'title' => $this->l('Header'),
'icon' => 'icon-file-text'
),
'input' => array(
array(
'type' => '',
'name'=> 'vania',
'min'=>0,
'max'=>100,
'step'=>1
),
'submit' => array(
'title' => $this->l('Generate')
)
)
)
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = 1;
$this->fields_formm = array();
$helper->submit_action = 'submitform';
return $helper->generateForm(array($fields_formm[0]));
}
}
?>
更多信息?代碼,例子,錯誤? –
如果您在產品,類別等其他模塊中找到任何其他模塊,請將其複製。但我很確定他們不存在。你必須爲此包含正確的JS插件。 –
你正在使用哪種版本的prestashop? – sarcom