function visitCheckbox(\cmu\html\form\products\Input $component) { $html = "<span "; $html .= $component->getHtmlClass(); $html .= ">"; $html .= $component->getCheckedValue(); $html .= "</span>"; return $html; }
protected function accept(\cmu\html\form\visitors\input\AbstractInputVisitor $visitor, \cmu\html\form\products\Input $component) { //get TYPE converted to upper case $type = ucfirst($component->getType()); //build method visit + type (from above) $method = "visit" . $type; //return the values from the new object function return $visitor->{$method}($component); }
function visitInput(\cmu\html\form\products\Input $component) { $html = "<input "; $html .= $component->getAttributes(); $html .= ">"; $html .= "</input>"; $html .= $component->getCaption(); //labels for RADIO and CHECKBOX $html .= $component->returnHint(); $html .= $component->returnErrorMessage(); return $html; }
function visitInput(\cmu\html\form\products\Input $component) { //if we have a value , type is TEXT and sanitize is set //we can only validate TEXT input if ($component->getType() == "text" && null !== $component->getSanitize() && null != $component->getValue()) { $sanitize = new \cmu\html\form\sanitize\SanitizeContext($component->getSanitize()); $component->setValue($sanitize->sanitizeText($component->getValue())); } }
function visitPassword(\cmu\html\form\products\Input $component) { return $this->returnKeyValue($component->getValue(), $component->getName(), $component->getValue()); }
function visitPassword(\cmu\html\form\products\Input $component) { if (null != $component->getValue()) { return true; } }