简体   繁体   中英

Prestashop disable Layout from module

I've created an API module in prestaShop and I am generating an XML output to a certain CMS page. Thing is that I can't disable the layout. I just need to render the XML output from the module (and no html) . Any ideas please? (I am not using the webservice classes)

At least.. Is it possible to do this from a module?

Thanks, Dan

Override the method "display" of your controller and output whatever you want.

If you do not want to display layout, do not call parent::display().

I have a problem like you. And I knew how to disable it.

You just need add two lines below to your module:

$this->display_header = false;
$this->display_footer = false;

Example:

public function initContent(){
   parent::initContent();
   $this->display_header = false;
   $this->display_footer = false;
   $this->setTemplate('display.tpl');
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM