Re: [SMARTY] Output buffering?

From: Date: Wed, 05 Mar 2003 20:20:31 +0000
Subject: Re: [SMARTY] Output buffering?
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8417@lists.php.net to get a copy of this message
Hi, I can't seem to get this to work. When this code is called (and output buffering is on), a blank page is returned to the browser. I get my expected page, however, when not using output buffering: - ------------ Before I assign vars to smarty: - ------------ $a_config['usingGZip'] = false; if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { if (extension_loaded('zlib')) { $a_config['usingGZip'] = true; ob_start('ob_gzhandler'); } } $smarty = new Smarty; ------------ When I want to display the page: - ------------ $smarty->display('main.tpl'); if ($a_config['usingGZip']) { $output = ob_get_contents(); ob_end_clean(); echo $output; } Any idea what I'm doing wrong? Cheers, James ----- Original Message ----- From: "Hinrich Donner" <hd@tiro.de> To: <smarty-general@lists.php.net> Sent: Tuesday, March 04, 2003 1:17 PM Subject: Re: [SMARTY] Output buffering? Hi, include 'Smarty.class.php'; ob_start('ob_gzhandler'); $smarty =& new Smarty(); $smarty->Display('my.tpl'); $output = ob_get_contents(); ob_end_clean(); echo $output; On Tuesday 04 March 2003 14:01, James Burrows wrote: > Hi there, > > Is it possible to perform output buffering using smarty? I'd like to gzip > my output before sending it to the browser. > > Thanks, > James -- Hinrich Donner -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#8417) next »