Path: blob/master/src/view/form/PHUIFormLayoutView.php
12249 views
<?php12/**3* This provides the layout of an AphrontFormView without actually providing4* the <form /> tag. Useful on its own for creating forms in other forms (like5* dialogs) or forms which aren't submittable.6*/7final class PHUIFormLayoutView extends AphrontView {89private $classes = array();10private $fullWidth;1112public function setFullWidth($width) {13$this->fullWidth = $width;14return $this;15}1617public function addClass($class) {18$this->classes[] = $class;19return $this;20}2122public function appendInstructions($text) {23return $this->appendChild(24phutil_tag(25'div',26array(27'class' => 'aphront-form-instructions',28),29$text));30}3132public function appendRemarkupInstructions($remarkup) {33$view = id(new AphrontFormView())34->setViewer($this->getViewer())35->newInstructionsRemarkupView($remarkup);3637return $this->appendInstructions($view);38}3940public function render() {41$classes = $this->classes;42$classes[] = 'phui-form-view';4344if ($this->fullWidth) {45$classes[] = 'phui-form-full-width';46}4748return phutil_tag(49'div',50array(51'class' => implode(' ', $classes),52),53$this->renderChildren());5455}56}575859