form() public static method

Takes a mixed variable, formats it for display in a form, and returns it.
public static form ( mixed $Mixed ) : string
$Mixed mixed An object, array, or string to be formatted.
return string
Ejemplo n.º 1
0
 /**
  * Creates a VALUE attribute for a form input and returns it in this format: [ value="VALUE"]
  *
  * @param string $FieldName The name of the field that contains the value in $this->_DataArray.
  * @param array $Attributes An associative array of attributes for the input. ie. maxlength, onclick,
  *    class, etc. If $Attributes contains a 'value' key, it will override the
  *    one automatically generated by $FieldName.
  * @return string
  */
 protected function _valueAttribute($FieldName, $Attributes)
 {
     // Value from $Attributes overrides the datasource and the postback.
     return ' value="' . Gdn_Format::form(arrayValueI('value', $Attributes, $this->getValue($FieldName))) . '"';
 }