Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758<?php
/** * This provides the layout of an AphrontFormView without actually providing * the <form /> tag. Useful on its own for creating forms in other forms (like * dialogs) or forms which aren't submittable. */final class PHUIFormLayoutView extends AphrontView {
private $classes = array(); private $fullWidth;
public function setFullWidth($width) { $this->fullWidth = $width; return $this; }
public function addClass($class) { $this->classes[] = $class; return $this; }
public function appendInstructions($text) { return $this->appendChild( phutil_tag( 'div', array( 'class' => 'aphront-form-instructions', ), $text)); }
public function appendRemarkupInstructions($remarkup) { $view = id(new AphrontFormView()) ->setViewer($this->getViewer()) ->newInstructionsRemarkupView($remarkup);
return $this->appendInstructions($view); }
public function render() { $classes = $this->classes; $classes[] = 'phui-form-view';
if ($this->fullWidth) { $classes[] = 'phui-form-full-width'; }
return phutil_tag( 'div', array( 'class' => implode(' ', $classes), ), $this->renderChildren());
}}