Path: blob/master/src/applications/diviner/view/DivinerParameterTableView.php
12256 views
<?php12final class DivinerParameterTableView extends AphrontTagView {34private $parameters;5private $header;67public function setParameters(array $parameters) {8$this->parameters = $parameters;9return $this;10}1112public function setHeader($text) {13$this->header = $text;14return $this;15}1617protected function getTagName() {18return 'div';19}2021protected function getTagAttributes() {22return array(23'class' => 'diviner-table-view',24);25}2627protected function getTagContent() {28require_celerity_resource('diviner-shared-css');2930$rows = array();31foreach ($this->parameters as $param) {32$cells = array();3334$type = idx($param, 'doctype');35if (!$type) {36$type = idx($param, 'type');37}3839$name = idx($param, 'name');40$docs = idx($param, 'docs');4142$cells[] = phutil_tag(43'td',44array(45'class' => 'diviner-parameter-table-type diviner-monospace',46),47$type);4849$cells[] = phutil_tag(50'td',51array(52'class' => 'diviner-parameter-table-name diviner-monospace',53),54$name);5556$cells[] = phutil_tag(57'td',58array(59'class' => 'diviner-parameter-table-docs',60),61$docs);6263$rows[] = phutil_tag('tr', array(), $cells);64}6566$table = phutil_tag(67'table',68array(69'class' => 'diviner-parameter-table-view',70),71$rows);7273$header = phutil_tag(74'span',75array(76'class' => 'diviner-table-header',77),78$this->header);7980return array($header, $table);81}8283}848586