当前位置: 首页>>代码示例>>PHP>>正文


PHP Main::getValidator方法代码示例

本文整理汇总了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;
 }
开发者ID:jamez341,项目名称:OGotcha,代码行数:34,代码来源:CombatReport.php

示例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);
         }
     }
 }
开发者ID:jamez341,项目名称:OGotcha,代码行数:24,代码来源:kokx.module.php


注:本文中的Main::getValidator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。