4 * This provides the layout of an AphrontFormView without actually providing
5 * the <form /> tag. Useful on its own for creating forms in other forms (like
6 * dialogs) or forms which aren't submittable.
8 final class PHUIFormLayoutView
extends AphrontView
{
10 private $classes = array();
13 public function setFullWidth($width) {
14 $this->fullWidth
= $width;
18 public function addClass($class) {
19 $this->classes
[] = $class;
23 public function appendInstructions($text) {
24 return $this->appendChild(
28 'class' => 'aphront-form-instructions',
33 public function appendRemarkupInstructions($remarkup) {
34 $view = id(new AphrontFormView())
35 ->setViewer($this->getViewer())
36 ->newInstructionsRemarkupView($remarkup);
38 return $this->appendInstructions($view);
41 public function render() {
42 $classes = $this->classes
;
43 $classes[] = 'phui-form-view';
45 if ($this->fullWidth
) {
46 $classes[] = 'phui-form-full-width';
52 'class' => implode(' ', $classes),
54 $this->renderChildren());