public function serialize(IResource $resource) { $snippet = $resource->getCleanFields()['snippet']; $snippet = preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*\$/", "\n", $snippet); // remove empty lines from the end //$snippet = preg_replace("/\r\n/", "\n", $snippet); // remove empty lines from the end $snippet = preg_replace('/^\\s+$/s', "\n", $snippet); $content = Templating::render('php.html.twig', ['comment_data' => $resource->getStringInfo(), 'content' => $snippet]); return $content; }
public function serialize(IResource $resource) { $content = Templating::render('simple.html.twig', ['data' => $resource->getStringInfo()]); return $content; }
public function serialize(IResource $resource) { $content = Templating::render('raw.html.twig', ['comment_data' => $resource->getStringInfo(), 'content' => $resource->getContent()]); return $content; }