public function getSaveData()
    {
        $this->defineFormFields();

        $result = [];

        /*
         * Source data
         */
        $data = $this->arrayName ? post($this->arrayName) : post();
        if (!$data) {
            $data = [];
        }

        /*
         * Spin over each field and extract the postback value
         */
        foreach ($this->allFields as $field) {
            /*
             * Disabled and hidden should be omitted from data set
             */
            if ($field->disabled || $field->hidden) {
                continue;
            }

            /*
             * Handle HTML array, eg: item[key][another]
             */
            $parts = HtmlHelper::nameToArray($field->fieldName);
            if (($value = $this->dataArrayGet($data, $parts)) !== null) {

                /*
                 * Number fields should be converted to integers
                 */
                if ($field->type === 'number') {
                    $value = !strlen(trim($value)) ? null : (float) $value;
                }

                $this->dataArraySet($result, $parts, $value);
            }
        }

        /*
         * Give widgets an opportunity to process the data.
         */
        foreach ($this->formWidgets as $field => $widget) {
            $parts = HtmlHelper::nameToArray($field);

            $widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
            $this->dataArraySet($result, $parts, $widgetValue);
        }

        return $result;
    }
public function getSaveData()
    {
        $this->defineFormFields();

        $result = [];

        /*
         * Source data
         */
        $data = $this->arrayName ? post($this->arrayName) : post();
        if (!$data) {
            $data = [];
        }

        /*
         * Spin over each field and extract the postback value
         */
        foreach ($this->allFields as $field) {
            /*
             * Disabled and hidden should be omitted from data set
             */
            if ($field->disabled || $field->hidden) {
                continue;
            }

            /*
             * Handle HTML array, eg: item[key][another]
             */
            $parts = HtmlHelper::nameToArray($field->fieldName);
            if (($value = $this->dataArrayGet($data, $parts)) !== null) {

                /*
                 * Number fields should be converted to integers
                 */
                if ($field->type === 'number') {
                    $value = !strlen(trim($value)) ? null : (float) $value;
                }

                $this->dataArraySet($result, $parts, $value);
            }
        }

        /*
         * Give widgets an opportunity to process the data.
         */
        foreach ($this->formWidgets as $field => $widget) {
            $parts = HtmlHelper::nameToArray($field);

            $widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
            $this->dataArraySet($result, $parts, $widgetValue);
        }

        return $result;
    }
public function getSaveData ( ) { $ this -> defineFormFields ( ) ; $ result = [ ] ; /*
         * Source data
         */ $ data = $ this -> arrayName ? post ( $ this -> arrayName ) : post ( ) ; if ( ! $ data ) { $ data = [ ] ; } /*
         * Spin over each field and extract the postback value
         */ foreach ( $ this -> allFields as $ field ) { /*
             * Disabled and hidden should be omitted from data set
             */ if ( $ field -> disabled || $ field -> hidden ) { continue ; } /*
             * Handle HTML array, eg: item[key][another]
             */ $ parts = HtmlHelper :: nameToArray ( $ field -> fieldName ) ; if ( ( $ value = $ this -> dataArrayGet ( $ data , $ parts ) ) !== null ) { /*
                 * Number fields should be converted to integers
                 */ if ( $ field -> type === 'number' ) { $ value = ! strlen ( trim ( $ value ) ) ? null : ( float ) $ value ; } $ this -> dataArraySet ( $ result , $ parts , $ value ) ; } } /*
         * Give widgets an opportunity to process the data.
         */ foreach ( $ this -> formWidgets as $ field => $ widget ) { $ parts = HtmlHelper :: nameToArray ( $ field ) ; $ widgetValue = $ widget -> getSaveValue ( $ this -> dataArrayGet ( $ result , $ parts ) ) ; $ this -> dataArraySet ( $ result , $ parts , $ widgetValue ) ; } return $ result ; }
Returns post data from a submitted form.

@return array
Returns post data from a submitted form .