コード例 #1
0
 /**
  * Validate the current user
  * 
  * @param \string $argument		Form argument name
  * @return \boolean				Successful validation
  */
 protected function _validate($argument)
 {
     $templateVariableContainer = $this->renderingContext->getTemplateVariableContainer();
     $request = $this->controllerContext->getRequest();
     $request = $request->getOriginalRequest() ?: $request;
     $arguments = $request->getArguments();
     return \Tollwerk\TwAntibot\Validation\Validator::validate($this->_extendedSettings, $argument && array_key_exists($argument, $arguments) ? $arguments[$argument] : null);
 }
コード例 #2
0
 /**
  * Validate the current user
  * 
  * @param \string $argument		Form argument name
  * @return \boolean				Successful validation
  */
 protected function _validate($argument = null)
 {
     $templateVariableContainer = $this->renderingContext->getTemplateVariableContainer();
     $request = $this->controllerContext->getRequest();
     $request = $request->getOriginalRequest() ?: $request;
     $arguments = $request->getArguments();
     // If the form has just been submitted
     if ($argument && array_key_exists($argument, $arguments)) {
         try {
             \Tollwerk\TwAntibot\Validation\Validator::validate($this->_extendedSettings, $arguments[$argument]);
         } catch (\Tollwerk\TwAntibot\Validation\Exception $e) {
             die(get_class($e));
         }
     }
     return true;
 }