本文整理汇总了PHP中FormDisplay::display方法的典型用法代码示例。如果您正苦于以下问题:PHP FormDisplay::display方法的具体用法?PHP FormDisplay::display怎么用?PHP FormDisplay::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormDisplay
的用法示例。
在下文中一共展示了FormDisplay::display方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
exit;
} else {
$error = $result;
}
}
// display forms
$GLOBALS['js_include'][] = 'config.js';
require './libraries/header.inc.php';
require './libraries/user_preferences.inc.php';
if ($error) {
$error->display();
}
if ($form_display->hasErrors()) {
// form has errors
?>
<div class="error config-form">
<b><?php
echo __('Cannot save settings, submitted form contains errors');
?>
</b>
<?php
$form_display->displayErrors();
?>
</div>
<?php
}
$form_display->display(true, true);
/**
* Displays the footer
*/
require './libraries/footer.inc.php';
示例2: PMA_Process_formset
/**
* Processes forms registered in $form_display, handles error correction
*
* @param FormDisplay $form_display Form to display
*
* @return void
*/
function PMA_Process_formset(FormDisplay $form_display)
{
if (isset($_GET['mode']) && $_GET['mode'] == 'revert') {
// revert erroneous fields to their default values
$form_display->fixErrors();
PMA_generateHeader303();
}
if (!$form_display->process(false)) {
// handle form view and failed POST
$form_display->display(true, true);
return;
}
// check for form errors
if (!$form_display->hasErrors()) {
PMA_generateHeader303();
return;
}
// form has errors, show warning
$separator = PMA_URL_getArgSeparator('html');
$page = isset($_GET['page']) ? $_GET['page'] : null;
$formset = isset($_GET['formset']) ? $_GET['formset'] : null;
$formset = $formset ? "{$separator}formset={$formset}" : '';
$formId = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : null;
if ($formId === null && $page == 'servers') {
// we've just added a new server, get its id
$formId = $form_display->getConfigFile()->getServerCount();
}
$formId = $formId ? "{$separator}id={$formId}" : '';
?>
<div class="error">
<h4><?php
echo __('Warning');
?>
</h4>
<?php
echo __('Submitted form contains errors');
?>
<br />
<a href="<?php
echo PMA_URL_getCommon() . $separator;
?>
page=<?php
echo $page . $formset . $formId . $separator;
?>
mode=revert">
<?php
echo __('Try to revert erroneous fields to their default values');
?>
</a>
</div>
<?php
$form_display->displayErrors();
?>
<a class="btn" href="index.php<?php
echo PMA_URL_getCommon();
?>
">
<?php
echo __('Ignore errors');
?>
</a>
<a class="btn" href="<?php
echo PMA_URL_getCommon() . $separator;
?>
page=<?php
echo $page . $formset . $formId . $separator;
?>
mode=edit"><?php
echo __('Show form');
?>
</a>
<?php
}
示例3: process_formset
/**
* Processes forms registered in $form_display, handles error correction
*
* @param FormDisplay $form_display
*
* @return void
*/
function process_formset(FormDisplay $form_display)
{
if (isset($_GET['mode']) && $_GET['mode'] == 'revert') {
// revert erroneous fields to their default values
$form_display->fixErrors();
// drop post data
header('HTTP/1.1 303 See Other');
header('Location: index.php');
exit;
}
if (!$form_display->process(false)) {
// handle form view and failed POST
$form_display->display(true, true);
} else {
// check for form errors
if ($form_display->hasErrors()) {
// form has errors, show warning
$separator = PMA_get_arg_separator('html');
$page = isset($_GET['page']) ? $_GET['page'] : null;
$formset = isset($_GET['formset']) ? $_GET['formset'] : null;
$formset = $formset ? "{$separator}formset={$formset}" : '';
$id = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : null;
if ($id === null && $page == 'servers') {
// we've just added a new server, get it's id
$id = ConfigFile::getInstance()->getServerCount();
}
$id = $id ? "{$separator}id={$id}" : '';
?>
<div class="error">
<h4><?php
echo __('Warning');
?>
</h4>
<?php
echo __('Submitted form contains errors');
?>
<br />
<a href="?page=<?php
echo $page . $formset . $id . $separator . PMA_generate_common_url() . $separator;
?>
mode=revert"><?php
echo __('Try to revert erroneous fields to their default values');
?>
</a>
</div>
<?php
$form_display->displayErrors();
?>
<a class="btn" href="index.php?<?php
echo PMA_generate_common_url();
?>
"><?php
echo __('Ignore errors');
?>
</a>
<a class="btn" href="?page=<?php
echo $page . $formset . $id . $separator . PMA_generate_common_url() . $separator;
?>
mode=edit"><?php
echo __('Show form');
?>
</a>
<?php
} else {
// drop post data
header('HTTP/1.1 303 See Other');
header('Location: index.php');
exit;
}
}
}