/** * Renders form begin. * @return string */ public static function renderFormBegin(Form $form, array $attrs, $withTags = TRUE) { $form->fireRenderEvents(); foreach ($form->getControls() as $control) { $control->setOption('rendered', FALSE); } $el = $form->getElementPrototype(); $el->action = (string) $el->action; $el = clone $el; if ($form->isMethod('get')) { $el->action = preg_replace('~\\?[^#]*~', '', $el->action, 1); } $el->addAttributes($attrs); return $withTags ? $el->startTag() : $el->attributes(); }