57 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Form\\Request')->getPrefix();
68 public function createRule($class, $arguments = array()) {
69 $class = strtolower((
string) $class);
70 $className =
'TYPO3\\CMS\\Form\\Validation\\' . ucfirst($class) .
'Validator';
84 public function addRule($rule, $fieldName, $breakOnError = FALSE) {
86 $this->rules[$prefix][] = array(
87 'instance' => (
object) $rule,
88 'fieldName' => (
string) $fieldName,
89 'breakOnError' => (
bool) $breakOnError
91 if ($rule->messageMustBeDisplayed()) {
92 if (!isset($this->messages[$prefix][$fieldName])) {
93 $this->messages[$prefix][$fieldName] = array();
95 end($this->rules[$prefix]);
96 $key = key($this->rules[$prefix]);
97 $message = $rule->getMessage();
98 $this->messages[$prefix][$fieldName][$key][$key + 1] = $message[
'cObj'];
99 $this->messages[$prefix][$fieldName][$key][($key + 1) .
'.'] = $message[
'cObj.'];
113 $this->errors[$prefix] = array();
115 if (is_array($this->rules[$prefix])) {
116 foreach ($this->rules[$prefix] as $key => $element) {
117 $rule = $element[
'instance'];
118 $fieldName = $element[
'fieldName'];
119 if ($rule->isValid()) {
123 if (!isset($this->errors[$prefix][$fieldName])) {
124 $this->errors[$prefix][$fieldName] = array();
126 $error = $rule->getError();
127 $this->errors[$prefix][$fieldName][$key][$key + 1] = $error[
'cObj'];
128 $this->errors[$prefix][$fieldName][$key][($key + 1) .
'.'] = $error[
'cObj.'];
129 if ($element[
'breakOnError']) {
143 return $this->messages[$this->
getPrefix()];
153 return $this->messages[$this->
getPrefix()][$name];
163 if (isset($this->messages[$this->
getPrefix()][$name])) {
175 return $this->errors[$this->
getPrefix()];
185 return $this->errors[$this->
getPrefix()][$name];
195 if (isset($this->errors[$this->
getPrefix()][$name])) {
static makeInstance($className)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.