mam kłopot z zapisaniem formularza stworzonego przy pomocy HelperForm
przy kliknięciu zapisz dostaję komunikat:
Method of module cannot be found at line 838 in file controllers/admin/AdminModulesController.php
poniżej kod z metodą która używa HelperForm
public function renderForm(){
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Artykuły'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'textarea',
'label' => $this->l('Artykuły'),
'desc' => $this->l('Podaj listę artykułów powiązanych z tym produktem, napisanych na blogu.'),
'autoload_rte' => true,
'lang' => false,
'rows' => 30,
'cols' => 100,
'name' => 'articles_for_product',
'required' => true
),
),
'submit' => array(
'title' => $this->l('Save')
)
),
);
$id_product = Tools::getValue('id_product');
$pmObj = ModelsPmtab::LoadByIdProduct($id_product);
$helper = new HelperForm();
//$helper->show_toolbar = true;
$helper->table = $this->table;
$helper->default_form_language = (int)Configuration::get('PS_LANG_DEFAULT');
$helper->module = $this;
$helper->allow_employee_form_lang = (int)Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG');
//$helper->identifier = $this->identifier;
$helper->submit_action = 'submit_articles_for_product';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->fields_value['articles_for_product'] = $pmObj->content;
return $helper->generateForm(array($fields_form));
}
dodanie do bazy chciałbym wywołać w hookActionProductSave - chyba że mam iść innym torem??