Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/metamta/view/PhabricatorMetaMTAMailSection.php
12256 views
1
<?php
2
3
/**
4
* Helper for building a rendered section.
5
*
6
* @task compose Composition
7
* @task render Rendering
8
* @group metamta
9
*/
10
final class PhabricatorMetaMTAMailSection extends Phobject {
11
private $plaintextFragments = array();
12
private $htmlFragments = array();
13
14
public function getHTML() {
15
return $this->htmlFragments;
16
}
17
18
public function getPlaintext() {
19
return implode("\n", $this->plaintextFragments);
20
}
21
22
public function addHTMLFragment($fragment) {
23
$this->htmlFragments[] = $fragment;
24
return $this;
25
}
26
27
public function addPlaintextFragment($fragment) {
28
$this->plaintextFragments[] = $fragment;
29
return $this;
30
}
31
32
public function addFragment($fragment) {
33
$this->plaintextFragments[] = $fragment;
34
$this->htmlFragments[] =
35
phutil_escape_html_newlines(phutil_tag('div', array(), $fragment));
36
37
return $this;
38
}
39
}
40
41