Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F987679
PHUIRemarkupView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PHUIRemarkupView.php
View Options
<?php
/**
* Simple API for rendering blocks of Remarkup.
*
* Example usage:
*
* $fancy_text = new PHUIRemarkupView($viewer, $raw_remarkup);
* $view->appendChild($fancy_text);
*
*/
final
class
PHUIRemarkupView
extends
AphrontView
{
private
$corpus
;
private
$markupType
;
const
DOCUMENT
=
'document'
;
public
function
__construct
(
PhabricatorUser
$viewer
,
$corpus
)
{
$this
->
setUser
(
$viewer
);
$this
->
corpus
=
$corpus
;
}
private
function
setMarkupType
(
$type
)
{
$this
->
markupType
(
$type
);
return
$this
;
}
public
function
render
()
{
$viewer
=
$this
->
getUser
();
$corpus
=
$this
->
corpus
;
$content
=
PhabricatorMarkupEngine
::
renderOneObject
(
id
(
new
PhabricatorMarkupOneOff
())
->
setPreserveLinebreaks
(
true
)
->
setContent
(
$corpus
),
'default'
,
$viewer
);
if
(
$this
->
markupType
==
self
::
DOCUMENT
)
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phabricator-remarkup phui-document-view'
,
),
$content
);
}
return
$content
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 6:41 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
238255
Default Alt Text
PHUIRemarkupView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment