Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103096367
AphrontPageView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 27, 06:26
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 1, 06:26 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24495510
Attached To
rPH Phabricator
AphrontPageView.php
View Options
<?php
abstract
class
AphrontPageView
extends
AphrontView
{
private
$title
;
public
function
setTitle
(
$title
)
{
$this
->
title
=
$title
;
return
$this
;
}
public
function
getTitle
()
{
$title
=
$this
->
title
;
if
(
is_array
(
$title
))
{
$title
=
implode
(
"
\x
C2
\x
B7 "
,
$title
);
}
return
$title
;
}
protected
function
getHead
()
{
return
''
;
}
protected
function
getBody
()
{
return
implode
(
''
,
$this
->
renderChildren
());
}
protected
function
getTail
()
{
return
''
;
}
protected
function
willRenderPage
()
{
return
;
}
protected
function
willSendResponse
(
$response
)
{
return
$response
;
}
protected
function
getBodyClasses
()
{
return
null
;
}
public
function
render
()
{
$this
->
willRenderPage
();
$title
=
phutil_escape_html
(
$this
->
getTitle
());
$head
=
$this
->
getHead
();
$body
=
$this
->
getBody
();
$tail
=
$this
->
getTail
();
$body_classes
=
$this
->
getBodyClasses
();
$body
=
phutil_render_tag
(
'body'
,
array
(
'class'
=>
nonempty
(
$body_classes
,
null
),
),
$body
.
$tail
);
$response
=
<<<EOHTML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{$title}</title>
{$head}
</head>
{$body}
</html>
EOHTML;
$response
=
$this
->
willSendResponse
(
$response
);
// TODO: [HTML] Make HTML safe.
return
phutil_safe_html
(
$response
);
}
}
Event Timeline
Log In to Comment