本文整理汇总了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.'));
}
}
}