[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PHUIBoxView extends AphrontTagView { 4 5 private $margin = array(); 6 private $padding = array(); 7 private $border = false; 8 9 public function addMargin($margin) { 10 $this->margin[] = $margin; 11 return $this; 12 } 13 14 public function addPadding($padding) { 15 $this->padding[] = $padding; 16 return $this; 17 } 18 19 public function setBorder($border) { 20 $this->border = $border; 21 return $this; 22 } 23 24 protected function getTagAttributes() { 25 require_celerity_resource('phui-box-css'); 26 $outer_classes = array(); 27 $outer_classes[] = 'phui-box'; 28 if ($this->border) { 29 $outer_classes[] = 'phui-box-border'; 30 } 31 foreach ($this->margin as $margin) { 32 $outer_classes[] = $margin; 33 } 34 foreach ($this->padding as $padding) { 35 $outer_classes[] = $padding; 36 } 37 return array('class' => $outer_classes); 38 } 39 40 public function getTagName() { 41 return 'div'; 42 } 43 44 public function getTagContent() { 45 return $this->renderChildren(); 46 } 47 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |