Golden Man Posted October 23, 2014 Share Posted October 23, 2014 Bonjour, j'ai développe un module sous Prestashop 1.6, maintenant j'ai du mal a gérer deux tables dans la base de données, je sais pas exactement comment je peux manipuler les fields_list mais ça va pour les forms. voila un morceau de code : public function getContent() { $output = null; if (Tools::isSubmit('submit'.$this->name)) { $my_module_name = strval(Tools::getValue('printpics')); if (!$my_module_name || empty($my_module_name) || !Validate::isGenericName($my_module_name)) $output .= $this->displayError($this->l('Invalid Configuration value')); else { Configuration::updateValue('printpics', $my_module_name); $output .= $this->displayConfirmation($this->l('Settings updated')); } } return $output.$this->displayForm(); } public function displayForm() { // Get default language $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); // Init Fields form array $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Settings'), ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Configuration champs'), 'name' => 'MYMODULE_NAME', 'size' => 20, 'required' => true ) ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'button' ) ); $helper = new HelperForm(); // Load current value $helper->fields_value['MYMODULE_NAME'] = Configuration::get('MYMODULE_NAME'); return $helper->generateForm($fields_form); } Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 24, 2014 Share Posted October 24, 2014 Hello, Tu devrais poster dans le forum en français et lire le guide du développeur: http://doc.prestashop.com/pages/viewpage.action?pageId=20840571. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now