本文整理汇总了PHP中Main::getValidator方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::getValidator方法的具体用法?PHP Main::getValidator怎么用?PHP Main::getValidator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::getValidator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSettings
/**
* @return array
*/
public function getSettings()
{
$vl = $this->_main->getValidator();
$this->_settings = $this->getDefaultSettings();
$theme = $vl->getVariable('theme', 'value');
$middletext = $vl->getVariable('middletext', 'value');
$hidetime = $vl->getVariable('hidetime', 'value');
$merge = $vl->getVariable('merge', 'value');
$advanced = $vl->getVariable('advanced', 'value');
$quotes = $vl->getVariable('spoiler', 'value');
if ($theme != "" && isset($this->_themes[$theme])) {
$this->_settings['theme'] = $theme;
}
if ($middletext != "") {
$this->_settings['middle_text'] = $middletext;
}
if ($hidetime != '1') {
$this->_settings['hide_time'] = false;
}
if ($merge != '1') {
$this->_settings['merge_fleets'] = false;
}
if ($advanced == '1') {
$this->_settings['advanced_summary'] = true;
}
if ($quotes == '1') {
$this->_settings['harvest_spoiler'] = true;
}
$this->_settings['lang'] = $this->_main->getLang();
return $this->_settings;
}
示例2: execute
/**
* @param Main $main
*/
public function execute($main)
{
$crService = new Default_Service_CombatReport($main);
if ($main->getValidator()->isValid() && $main->getValidator()->isValidated()) {
try {
$settings = $crService->getSettings();
$report = $crService->getReport();
$renderer = $crService->getRenderer($settings, $report);
$renderedReport = $renderer->renderReport();
$renderedTitle = $renderer->renderTitle();
$renderedPreview = Default_Renderer_Helper::parseBBCode($renderedReport);
$main->getStore()->set('result-content', $renderedReport);
$main->getStore()->set('result-title', $renderedTitle);
$main->getStore()->set('result-preview', $renderedPreview);
} catch (Exception $e) {
//Debug::arr( $e );
$main->addInfo(new Info($main->getDict()->getVal('Bad Cr'), Info::ERROR));
$main->getStore()->set('error', true);
}
}
}