本文整理匯總了PHP中Icinga\Web\Form::setRequirements方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::setRequirements方法的具體用法?PHP Form::setRequirements怎麽用?PHP Form::setRequirements使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Icinga\Web\Form
的用法示例。
在下文中一共展示了Form::setRequirements方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setupPage
/**
* Setup the given page that is either going to be displayed or validated
*
* @param Form $page The page to setup
* @param Request $request The current request
*/
public function setupPage(Form $page, Request $request)
{
if ($page->getName() === 'setup_requirements') {
$page->setRequirements($this->getRequirements());
} elseif ($page->getName() === 'setup_monitoring_summary') {
$page->setSummary($this->getSetup()->getSummary());
$page->setSubjectTitle(mt('monitoring', 'the monitoring module', 'setup.summary.subject'));
} elseif ($this->getDirection() === static::FORWARD && ($page->getName() === 'setup_monitoring_ido' || $page->getName() === 'setup_monitoring_livestatus')) {
if (($authDbResourceData = $this->getPageData('setup_auth_db_resource')) !== null && $authDbResourceData['name'] === $request->getPost('name') || ($configDbResourceData = $this->getPageData('setup_config_db_resource')) !== null && $configDbResourceData['name'] === $request->getPost('name') || ($ldapResourceData = $this->getPageData('setup_ldap_resource')) !== null && $ldapResourceData['name'] === $request->getPost('name')) {
$page->error(mt('monitoring', 'The given resource name is already in use.'));
}
}
}