class MyProcessor extends COutputProcessor
{
public function init()
{
$this->onProcessOutput = array('TTest', 'lower');
$this->onProcessOutput = array('TTest', 'reverse');
parent::init();
}
}
class TTest
{
public function lower($event)
{
$event->output = strtolower($event->output);
}
public function reverse($event)
{
$event->output = strrev($event->output);
}
}
$this->beginWidget('MyProcessor');
echo 'This is just a Test';
$this->endWidget();
if you just want to use two methods… you need to handle the output in the last one… like
class TTest
{
public function lower($event)
{
$event->output = strtolower($event->output);
}
public function reverse($event)
{
$event->output = strrev($event->output);
echo $event->output;
$event->handled=true;
}
}