src/Form/Base.php
public function getFormElements()
    {
        $sm = $this->getServiceLocator();
        $formElements = array();
        $placeholders = $this->getPlaceholderParameters();
        $replacePlaceholderWithValues = array();
        foreach ($this->formElements as $element) {
            // Remove form element if it is available in the remove list
            if (in_array($element['name'], $this->removeElements)) {
                continue;
            }
            $formElement = $this->formatFormElement($element);
            // Replace placeholder with default values
            $replacePlaceholderWithValues = $sm->get($this->moduleService)->defaultConfig('placeholder');
            // Replace placeholder with global form values
            if (!empty($placeholders) && is_array($placeholders)) {
                // Replace placeholder with global values
                if (array_key_exists('global', $placeholders) &&  !empty($placeholders['global']) &&  is_array($placeholders['global'])) {
                    $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['global']);
                }
                // Replace placeholder with element form values
                if (array_key_exists('element', $placeholders) &&  !empty($placeholders['element']) &&  is_array($placeholders['element'])) {
                    if (array_key_exists($element['name'], $placeholders['element'])) {
                        $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['element'][$element['name']]);
                    }
                }
            }
            $formElement = $this->searchAndReplacePlaceHolders($formElement, $replacePlaceholderWithValues);
            $formElements[] = $formElement;
        }
        return $formElements;
    }
public function getFormElements()
    {
        $sm = $this->getServiceLocator();
        $formElements = array();
        $placeholders = $this->getPlaceholderParameters();
        $replacePlaceholderWithValues = array();
        foreach ($this->formElements as $element) {
            // Remove form element if it is available in the remove list
            if (in_array($element['name'], $this->removeElements)) {
                continue;
            }
            $formElement = $this->formatFormElement($element);
            // Replace placeholder with default values
            $replacePlaceholderWithValues = $sm->get($this->moduleService)->defaultConfig('placeholder');
            // Replace placeholder with global form values
            if (!empty($placeholders) && is_array($placeholders)) {
                // Replace placeholder with global values
                if (array_key_exists('global', $placeholders) &&  !empty($placeholders['global']) &&  is_array($placeholders['global'])) {
                    $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['global']);
                }
                // Replace placeholder with element form values
                if (array_key_exists('element', $placeholders) &&  !empty($placeholders['element']) &&  is_array($placeholders['element'])) {
                    if (array_key_exists($element['name'], $placeholders['element'])) {
                        $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['element'][$element['name']]);
                    }
                }
            }
            $formElement = $this->searchAndReplacePlaceHolders($formElement, $replacePlaceholderWithValues);
            $formElements[] = $formElement;
        }
        return $formElements;
    }
public function getFormElements ( ) { $ sm = $ this -> getServiceLocator ( ) ; $ formElements = array ( ) ; $ placeholders = $ this -> getPlaceholderParameters ( ) ; $ replacePlaceholderWithValues = array ( ) ; foreach ( $ this -> formElements as $ element ) { // Remove form element if it is available in the remove list if ( in_array ( $ element [ 'name' ] , $ this -> removeElements ) ) { continue ; } $ formElement = $ this -> formatFormElement ( $ element ) ; // Replace placeholder with default values $ replacePlaceholderWithValues = $ sm -> get ( $ this -> moduleService ) -> defaultConfig ( 'placeholder' ) ; // Replace placeholder with global form values if ( ! empty ( $ placeholders ) && is_array ( $ placeholders ) ) { // Replace placeholder with global values if ( array_key_exists ( 'global' , $ placeholders ) && ! empty ( $ placeholders [ 'global' ] ) && is_array ( $ placeholders [ 'global' ] ) ) { $ replacePlaceholderWithValues = array_merge ( $ replacePlaceholderWithValues , $ placeholders [ 'global' ] ) ; } // Replace placeholder with element form values if ( array_key_exists ( 'element' , $ placeholders ) && ! empty ( $ placeholders [ 'element' ] ) && is_array ( $ placeholders [ 'element' ] ) ) { if ( array_key_exists ( $ element [ 'name' ] , $ placeholders [ 'element' ] ) ) { $ replacePlaceholderWithValues = array_merge ( $ replacePlaceholderWithValues , $ placeholders [ 'element' ] [ $ element [ 'name' ] ] ) ; } } } $ formElement = $ this -> searchAndReplacePlaceHolders ( $ formElement , $ replacePlaceholderWithValues ) ; $ formElements [ ] = $ formElement ; } return $ formElements ; }
Get form elements in array format with values merged from placeholder

@return array $formElements
Get form elements in array format with values merged from placeholder