list.blade.php
@php
$maxLength
= 350;
if
(mb_strlen(
strip_tags
(
$document
->getContent(false))) >
$maxLength
){
// $content = preg_replace('/<img[^>]*>/', '', $document->variables['content']);
// $shortContent = mb_substr($content, 0, $maxLength) . '...';
$fullUrl
= getUrl(
'document_srl'
,
$document
->document_srl);
// 문서의 URL 생성
$content
=
$document
->getSummary(
$maxLength
);
$content
.=
" <a href='"
.
$fullUrl
.
"' class='read-more'>더보기</a>"
;
echo
$content
;
}
else
{
// echo '이하';
$content
= preg_replace(
'/<img[^>]*>/'
,
''
,
$document
->variables[
'content'
]);
// echo $document->getContent(false);
echo
$content
;
}
@endphp