Jump to content

Controller With Ajax

Recommended Posts



I would appreciate any help on this. I am doing a module... and I need that after pressing some button DIV element would show different content (depending on the response).


This is my controllers code:



public function initContent()




if(!isset($_GET['oper'])) {


$smarty = $this->context->smarty;


$tpl_vars['tips_optimization'] = $_SERVER['REQUEST_URI'];

$tpl_vars['postvar'] = $_GET['id'];




$export = new Export(Db::getInstance(), _DB_PREFIX_);




$tpl_vars['result'] = $export->getProductsExcel();





elseif($_GET['oper'] == 'export') {











After pressing the button and sending the oper parameter with value "export" it responses me with the "Test" text and it packs it inside the template.

Is it possible to tell the initContent not to pack the response inside the template? I would like to receive only the plain text.


I ve attached already the printscreen how it looks now. This behaviour is not correct :( We see here administration panel with another administration panel included.


Thanks for any hits on this.


Link to comment
Share on other sites

  • Create New...