public static function form($formname, $runner, $repost_form_after_submit = false) { $repost = $repost_form_after_submit; \Routerunner\Helper::loader($runner, trim($runner->route, '\\') . '.' . $formname . '.input', $output); if (isset($runner->form_override)) { $output = array_merge($output, $runner->form_override); if (isset($runner->form_override['input'])) { $runner->form_context[$formname]['input'] = $runner->form_override['input']; } } $html = ''; if (isset($output['form'], $output['input'])) { $form = new \Routerunner\Form($runner, $formname, $output, $repost_form_after_submit); $html = $form->render($runner); $form_addon = $form->field($form->id_field) . $form->field('_routerunner_form_nonce'); $html = str_replace('</form>', $form_addon . '</form>', $html); if (\runner::stack("form_failed:" . $formname) === true) { $repost = true; \runner::stack("form_failed:" . $formname, false); } if ($repost && $repost_form_after_submit == 'submit') { $repost_form_after_submit = 'get'; $form = new \Routerunner\Form($runner, $formname, $output, $repost_form_after_submit); $html .= $form->render($runner); } } return $html; }