public function renderDocumentAttribute(\Twig_Environment $twig, $attribute, $document = null)
{
if (null === $document) {
$document = $this->getCarewGlobals($twig)->document;
} else {
if (!$document instanceof Document) {
$document = $this->getDocumentWithPath($twig, $document);
}
}
$parameters = array('document' => $document);
return $this->renderBlock($twig, 'document_' . $attribute, $parameters);
}