diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index c24478afa1..d7eb68cd88 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1652,7 +1652,11 @@ phutil_register_library_map(array(
'AphrontTokenizerTemplateView' => 'AphrontView',
'AphrontTypeaheadTemplateView' => 'AphrontView',
'AphrontUsageException' => 'AphrontException',
- 'AphrontView' => 'Phobject',
+ 'AphrontView' =>
+ array(
+ 0 => 'Phobject',
+ 1 => 'PhutilSafeHTMLProducerInterface',
+ ),
'AphrontWebpageResponse' => 'AphrontHTMLResponse',
'AuditPeopleMenuEventListener' => 'PhutilEventListener',
'CelerityPhabricatorResourceController' => 'CelerityResourceController',
diff --git a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
index 4cd6365b68..bf7ac621e1 100644
--- a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
@@ -54,7 +54,7 @@ final class PhabricatorCalendarBrowseController
$nav->appendChild(
array(
$this->getNoticeView(),
- hsprintf('
%s
', $month_view->render()),
+ hsprintf('%s
', $month_view),
));
return $this->buildApplicationPage(
diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php
index 193e3520ca..03328191a9 100644
--- a/src/applications/differential/view/DifferentialInlineCommentEditView.php
+++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php
@@ -55,11 +55,10 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'method' => 'POST',
'sigil' => 'inline-edit-form',
),
- $this->renderSingleView(
- array(
- $this->renderInputs(),
- $this->renderBody(),
- )));
+ array(
+ $this->renderInputs(),
+ $this->renderBody(),
+ ));
return hsprintf(
''.
@@ -130,12 +129,11 @@ final class DifferentialInlineCommentEditView extends AphrontView {
array(
'class' => 'differential-inline-comment-edit-buttons',
),
- $this->renderSingleView(
- array(
- $formatting,
- $buttons,
- phutil_tag('div', array('style' => 'clear: both'), ''),
- )));
+ array(
+ $formatting,
+ $buttons,
+ phutil_tag('div', array('style' => 'clear: both'), ''),
+ ));
return javelin_tag(
'div',
@@ -148,12 +146,11 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'length' => $this->length,
),
),
- $this->renderSingleView(
- array(
- $title,
- $body,
- $edit,
- )));
+ array(
+ $title,
+ $body,
+ $edit,
+ ));
}
}
diff --git a/src/docs/developer/rendering_html.diviner b/src/docs/developer/rendering_html.diviner
index d285aabab6..6fa6a21df2 100644
--- a/src/docs/developer/rendering_html.diviner
+++ b/src/docs/developer/rendering_html.diviner
@@ -20,6 +20,7 @@ from XSS and render correctly. Broadly:
- Combine elements with arrays, not string concatenation.
- @{class:AphrontView} subclasses should return a
@{class@libphutil:PhutilSafeHTML} object from their `render()` method.
+ - @{class:AphrontView} subclasses act like tags when rendering.
- @{function:pht} has some special rules.
- There are some other things that you should be aware of.
- Do not use @{function:phutil_render_tag} or @{function:javelin_render_tag},
@@ -124,6 +125,10 @@ return `phutil_tag()` or `javelin_tag()`:
return phutil_tag('div', ...);
+You can use an @{class:AphrontView} subclass like you would a tag:
+
+ phutil_tag('div', array(), $view);
+
= Internationalization: pht() =
The @{function:pht} function has some special rules. If any input to
diff --git a/src/view/AphrontView.php b/src/view/AphrontView.php
index 7edaf02d95..0bd218c741 100644
--- a/src/view/AphrontView.php
+++ b/src/view/AphrontView.php
@@ -1,6 +1,7 @@
render();
+ }
+
}
diff --git a/src/view/layout/PhabricatorPropertyListView.php b/src/view/layout/PhabricatorPropertyListView.php
index 248675498f..645fdbf084 100644
--- a/src/view/layout/PhabricatorPropertyListView.php
+++ b/src/view/layout/PhabricatorPropertyListView.php
@@ -145,8 +145,7 @@ final class PhabricatorPropertyListView extends AphrontView {
$shortcuts = null;
if ($this->hasKeyboardShortcuts) {
- $shortcuts =
- id(new AphrontKeyboardShortcutsAvailableView())->render();
+ $shortcuts = new AphrontKeyboardShortcutsAvailableView();
}
return array(