/**
  * SelectField::getValue()
  *
  * Return the value of the field
  *
  * @return mixed
  * @access public
  * @author Teye Heimans     
  */
 function getValue()
 {
     // are multiple selects possible?
     if ($this->_bMultiple) {
         // is there a value ?
         if (isset($this->_mValue)) {
             if (is_string($this->_mValue)) {
                 return explode(',', $this->_mValue);
             }
         } else {
             return array();
         }
     }
     return parent::getValue();
 }
Example #2
0
 function getValue()
 {
     return $this->imgDir . parent::getValue();
 }
 public function get($instance, Field $f)
 {
     return $f->getValue($instance);
 }
Example #4
0
 public function getValue($condense = true)
 {
     if ($this->value === "" || is_array($this->value) && !count($this->value)) {
         return $this->emptyValue;
     }
     return parent::getValue();
 }
Example #5
0
 /**
  * Getter for field's value
  * @return mixed
  */
 public function getValue()
 {
     return !is_null(parent::getValue()) ? date($this->outputFormat, parent::getValue()) : null;
 }
 public function validate(Field $field)
 {
     $l = strlen($field->getValue());
     if ($l < $this->min) {
         return $field->addError(sprintf($this->too_short, $field->getName(), $this->min));
     } elseif ($l > $this->max) {
         return $field->addError(sprintf($this->too_long, $field->getName(), $this->max));
     }
 }
Example #7
0
 protected static function renderButtonInput(Field $field)
 {
     return sprintf('<button type="%s" name="%s" value="%s" %s>%s</button>', $field->getType(), $field->getName(), $field->getValue(), $field->getAttributes(), $field->getLabel());
 }
Example #8
0
 /**
  * {@inheritdoc}
  *
  * @return int|float
  */
 public function getValue()
 {
     // Ensure value is int or float; adding 0 will convert type from string
     return 0 + parent::getValue();
 }