Ejemplo n.º 1
0
 private function checkFilterSet($component)
 {
     if (null !== $component->getFiltertype()) {
         $validator = new \cmu\html\form\validate\ValidatorContext($component->getFiltertype());
         if ($validator->validateText($component->getValue())) {
             return true;
         } else {
             $component->setErrormessage($validator->getErrorMessagesString());
             //set Fielderrormessage in $component
         }
     } else {
         //no filter set
         return true;
     }
 }
Ejemplo n.º 2
0
 function visitTextArea(\cmu\html\form\products\TextArea $component)
 {
     //we can only validate TEXT input
     if (null !== $component->getFiltertype()) {
         $validator = new \cmu\html\form\validate\ValidatorContext($component->getFiltertype());
         if ($validator->validateText($component->getText())) {
             return true;
         } else {
             $component->setErrormessage($validator->getErrorMessagesString());
             //set Fielderrormessage in $component
         }
         //no filter to check against
     } else {
         return true;
     }
 }