@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DivinerSectionView extends AphrontTagView {
4
5 private $header;
6 private $content;
7
8 public function addContent($content) {
9 $this->content[] = $content;
10 return $this;
11 }
12
13 public function setHeader($text) {
14 $this->header = $text;
15 return $this;
16 }
17
18 protected function getTagName() {
19 return 'div';
20 }
21
22 protected function getTagAttributes() {
23 return array(
24 'class' => 'diviner-document-section',
25 );
26 }
27
28 protected function getTagContent() {
29 require_celerity_resource('diviner-shared-css');
30
31 $header = id(new PHUIHeaderView())
32 ->setBleedHeader(true)
33 ->addClass('diviner-section-header')
34 ->setHeader($this->header);
35
36 $content = phutil_tag_div('diviner-section-content', $this->content);
37
38 return array($header, $content);
39 }
40
41}