63 global $APPLICATION, $USER, $DB;
65 $templatePath = $this->searchTemplate($template);
67 if ($templatePath !=
'' &&
IO\File::isFileExists($templatePath))
71 if ($this->initiateMode == self::STREAM)
73 require($templatePath);
75 if ($this->service->getField(
'ENCODING') !=
'')
77 define(
"BX_SALE_ENCODING", $this->service->getField(
'ENCODING'));
78 AddEventHandler(
'main',
'OnEndBufferContent', array($this,
'OnEndBufferContent'));
81 elseif ($this->initiateMode == self::STRING)
84 $content = require($templatePath);
86 $buffer = ob_get_contents();
90 if ($this->service->getField(
'ENCODING') !=
'')
93 $content = Text\Encoding::convertEncoding($content, $encoding, $this->service->getField(
'ENCODING'));
96 $result->setTemplate($content);
391 if ($this->
isClone() && $cloneEntity->contains($this))
393 return $cloneEntity[$this];
396 $serviceHandlerClone = clone $this;
397 $serviceHandlerClone->isClone =
true;
399 if (!$cloneEntity->contains($this))
401 $cloneEntity[$this] = $serviceHandlerClone;
406 if ($cloneEntity->contains($this->service))
412 return $serviceHandlerClone;