<?php
	$doc_id = $tbldocument->getDocId();
	$c = new Criteria();
	$c->add(TblcommentPeer::CM_DOCUMENT , $doc_id);
	$numComment = TblcommentPeer::doCount($c);
	if($numComment)
		echo link_to($numComment, 'comment/list?filter=filter&filters[cm_document]='.$doc_id);
	else 
		echo $numComment;
	
?>