/** * Adds Parsley data attributes to field options if Parsley is enabled * * @param string $field * @param array $options * @return array */ protected function _initInputField($field, $options = array()) { $result = parent::_initInputField($field, $options); if (!isset($this->_processor)) { return $result; } $result = $this->_processor->processInput($field, $result, $this->requestType === 'put'); return $result; }
/** * Overwrite the default method with custom enhancements * * @return array options */ protected function _initInputField($field, $options = array()) { $normalize = true; if (isset($options['normalize'])) { $normalize = $options['normalize']; unset($options['normalize']); } $options = parent::_initInputField($field, $options); if (!empty($options['value']) && is_string($options['value']) && $normalize) { $options['value'] = str_replace(array("\t", "\r\n", "\n"), ' ', $options['value']); } return $options; }