[eluser]tonanbarbarian[/eluser]
why not try something like this
add the following code to your controllers
Code:
function _output($output) {
if (!$this->_ajax) {
require(’E:/SHARED/DAWEB/progettiweb/myproject/php_speedy/php_speedy.php’);
echo $output;
$compressor->finish();
} else {
echo $output;
}
}
This will use your compression code if the _ajax property of the controller is false
So then you just need to declare the variable in the controller
Code:
class XXX extends Controller {
var $_ajax = false;
function xxx() {
}
...
}
and then if the method in the controller will be returning ajax set the property to true
Code:
$this->_ajax = true;
much neater and you do not have to put the code in multiple times