Homec4science

Provide an "HTMLProducer" interface so Views can work like tags

Authored by epriestley <git@epriestley.com> on Mar 9 2013, 22:52.

Description

Provide an "HTMLProducer" interface so Views can work like tags

Summary:
Currently, we have this:

phutil_tag('div', array(), array($tag1, $tag2));

...but this:

phutil_tag('div', array(), array($view1->render(), $view2->render());

...or, if you have a mixture of things:

// ONLY works in AphrontView
phutil_tag('div', array(), $this->renderSingleView(array($tag1, $tag2)));

This is unintuitive and awkward. Allow objects other than PhutilSafeHTML to render into PhutilSafeHTML, so we can drop most render() and renderSingleView() calls.

(We could make PhutilSafeHTML implement this, but I think it's a little clearer if we don't.)

Test Plan: See next diff.

Reviewers: chad, vrana

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5305

Details

Committed
epriestley <git@epriestley.com>Mar 9 2013, 22:52
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUe37475a0b83a: Implement PHP-mode find.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU8072babfcf72: Provide an "HTMLProducer" interface so Views can work like tags (authored by epriestley <git@epriestley.com>).Mar 9 2013, 22:52