Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/view/layout/PhabricatorAnchorView.php
12241 views
1
<?php
2
3
final class PhabricatorAnchorView extends AphrontView {
4
5
private $anchorName;
6
private $navigationMarker;
7
8
public function setAnchorName($name) {
9
$this->anchorName = $name;
10
return $this;
11
}
12
13
public function setNavigationMarker($marker) {
14
$this->navigationMarker = $marker;
15
return $this;
16
}
17
18
public function render() {
19
$marker = null;
20
if ($this->navigationMarker) {
21
$marker = javelin_tag(
22
'legend',
23
array(
24
'class' => 'phabricator-anchor-navigation-marker',
25
'sigil' => 'marker',
26
'meta' => array(
27
'anchor' => $this->anchorName,
28
),
29
),
30
'');
31
}
32
33
$anchor = phutil_tag(
34
'a',
35
array(
36
'name' => $this->anchorName,
37
'id' => $this->anchorName,
38
'class' => 'phabricator-anchor-view',
39
),
40
'');
41
42
return array($marker, $anchor);
43
}
44
45
}
46
47