buffer, process it and return it public function process(){ if (class_exists('Translate')) { $trans = new Translate(); return $trans->translation($this->buffer); } else { return $this->buffer; } } }