Bootstrap is missing? in an HelpersOptions form it does seem to...



  • I have this code in a displayForm() for a new module.

    $default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
            $fields_options = array(
                'Paramêtres' => array(
                    'title' => $this->l('Paramétrage'),
                    'fields' => array(
                        'ACOLYTE_VDFCKOI' => array(
                            'title' => $this->l('BLOC: Viandes de la ferme c\'est quoi?'),
                            'type' => 'textareaLang',
                            'identifier' => 'id_ckoi',
                            'cols' => 60,
                            'rows' => 5,
                        ),
                    ),
                    'submit' => array(
                        'title' => $this->l('Save'),
                        'class' => 'button'
                    ),
                ),
            );
            
            $this->helper = new HelperOptions($this);
            // Module, token and currentIndex
            $this->helper->id = $this->id;
            $this->helper->module = $this;
            $this->helper->name_controller = $this->name;
            $this->helper->token = Tools::getAdminTokenLite('AdminModules');
            $this->helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
            // Language
            $this->helper->default_form_language = $default_lang;
            $this->helper->allow_employee_form_lang = $default_lang;
            
            // Title and toolbar
            $this->helper->title = $this->displayName;
            $this->helper->show_toolbar = true;
            $this->helper->toolbar_scroll = true;
            $this->helper->submit_action = 'submit'.$this->name;
            $this->helper->toolbar_btn = array(
                'save' => array(
                    'desc' => $this->l('Save'),
                    'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.
                        '&token='.Tools::getAdminTokenLite('AdminModules'),
                ),
                'back' => array(
                    'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'),
                    'desc' => $this->l('Back to list')
                )
            );
            
            // Load current value
            $this->helper->fields_value['ACOLYTE_VDFCKOI'] = Configuration::get('ACOLYTE_VDFCKOI');
            $this->helper->tpl_vars = array(
                'languages'    => $this->context->controller->getLanguages(),
                'id_language'  => $this->context->language->id,
            );
            return $this->helper->generateOptions($fields_options);
    

    But somehow the form in the configure page in the back office looks very odd:
    http://c2.acolyte.ws/Screenshot-at-09-09-53.png

    What am I doing wrong?


  • Global Moderator

    Not sure what you mean with odd!? That’s the old style of forms.

    Have you used

    $this->bootstrap = true;
    

    In your construct method?



  • @wakabayashi Not sure why that was set to false. TY VM!


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.