public function renderBegin()
{
$this->counter = 0;
foreach ($this->form->getControls() as $control) {
$control->setOption('rendered', FALSE);
}
if ($this->form->isMethod('get')) {
$el = clone $this->form->getElementPrototype();
$query = parse_url($el->action, PHP_URL_QUERY);
$el->action = str_replace("?{$query}", '', $el->action);
$s = '';
foreach (preg_split('#[;&]#', $query, NULL, PREG_SPLIT_NO_EMPTY) as $param) {
$parts = explode('=', $param, 2);
$name = urldecode($parts[0]);
if (!isset($this->form[$name])) {
$s .= Html::el('input', ['type' => 'hidden', 'name' => $name, 'value' => urldecode($parts[1])]);
}
}
return $el->startTag() . ($s ? "\n\t" . $this->getWrapper('hidden container')->setHtml($s) : '');
} else {
return $this->form->getElementPrototype()->startTag();
}
}