在prestashop 1.5.6.2中的Helperform

时间:2014-02-24 08:22:50

标签: prestashop-1.5

我为自定义模块控制器创建模板。使用这些代码:

class SolrBrigdeIndexciesController extends ModuleAdminController{


  public function __contruct(){
    $this->className = 'Configuration';
    $this->table = 'configuration';
    parent::__contruct();
    $this->fields_form = array(
        'legend' => array(
            'title' => $this->l('By order status'),
            //'image' => '../img/admin/pdf.gif'
        ),
        'input' => array(
            array(
                'type' => 'checkbox',
                'label' => $this->l('Statuses:'),
                'name' => 'id_order_state',
                'values' => array(
                    'query' => OrderState::getOrderStates($this->context->language->id),
                    'id' => 'id_order_state',
                    'name' => 'name'
                ),
                'desc' => $this->l('You can also export orders which have not been charged yet.').' (<img src="../img/admin/charged_ko.gif" alt="" />).'
            )
        ),);    
}
public function initContent()
    {                   
        $this->content .= $this->renderForm();
        $this->context->smarty->assign(array(
            'content' => $this->content,
            'array1' => OrderState::getOrderStates($this->context->language->id),
            'url_post' => self::$currentIndex.'&token='.$this->token,
        ));
    }

}

但是当我访问此控制器时,表单不显示:页面为空 请帮我。谢谢提前

1 个答案:

答案 0 :(得分:0)

你应该把parent :: __ contruct();在__construct的末尾,我认为这会奏效。顺便说一下,你真的不需要initContent()函数。