Page 1 of 1

BackEnd : not render template and theme

Posted: Fri Jun 17, 2011 8:15 am
by eureka
Hi,

Like params "show_template" and "disable_theme" in FrontEnd, I'm searching a mean to get the same behaviour in BackEnd.

I have created my own module and want to allowed BackEnd user to download some data in different formats (CSV, PDF, ...).

For that, I use in my module some header() instructions, whose :

Code: Select all

header("Content-Type: application/csv");

The problem here, is that the start of the BackEnd template is embedded in my files. In other word, my CSV file owns :

Code: Select all

- HTML header
- header of BackEnd
- Navigation
- Start of page content
- Then my data at CSV format.

How could I do so that template is not embedded in my file when I process the header() ?

Thanks for ideas.

Re: BackEnd : not render template and theme

Posted: Mon Jun 20, 2011 12:21 pm
by eureka
If someone has already implemented AJAX behaviour in BackEnd I imagine he has found a way to retrieve data without all the template.
That is an idea.

Re: BackEnd : not render template and theme

Posted: Mon Jun 20, 2011 8:50 pm
by Jos

Re: BackEnd : not render template and theme

Posted: Wed Jun 22, 2011 1:08 pm
by eureka
Hi and thanks Jos !

For information, a way is to perform a :

Code: Select all

ob_end_clean();
before generating data.

For example :

Code: Select all

ob_end_clean();
ob_start();
// stuff here
ob_end_flush();