action = $action; return $this; } public function setMethod($method) { $this->method = $method; return $this; } public function render() { return phutil_render_tag( 'form', array( 'action' => $this->action, 'method' => $this->method, 'class' => 'aphront-form-view', ), $this->renderDataInputs(). $this->renderChildren()); } private function renderDataInputs() { $data = $this->data + array( '__form__' => 1, ); $inputs = array(); foreach ($data as $key => $value) { $inputs[] = phutil_render_tag( 'input', array( 'type' => 'hidden', 'name' => $key, 'value' => $value, )); } return implode("\n", $inputs); } }