HTML_QuickForm_Renderer_Object

HTML_QuickForm_Renderer_Object – Object representation of the form

Description

This renderer does not output anything itself, it returns the form structure as an object. This object can later be used for generating the output. A usage example is available for this renderer and the Flexy template engine, look in docs/renderers directory.

The form object structure is similar to the following:

 
QuickformForm Object
(
    [frozen] => 
    [javascript] => 
    [attributes] =>  action="/object.php" method="post" name="form" id="form"
    [requirednote] => <span style="font-size:80%; color:#ff0000;">*</span><span style="font-size:80%;"> denotes required field</span>
    [hidden] => 
    [errors] => stdClass Object
        (
        )

    [elements] => Array
        (
            [0] => QuickformElement Object
                (
                    [name] => session
                    [value] => 1234567890
                    [type] => hidden
                    [frozen] => 
                    [label] => 
                    [required] => 
                    [error] => 
                    [style] => 
                    [html] => <input name="session" type="hidden" value="1234567890" />
                    [separator] => 
                    [elements] => 
                )
                
            ...

        )

    [sections] => Array
        (
            [0] => stdClass Object
                (
                    [header] => Personal Information
                    [elements] => Array
                        (
                            [0] => QuickformElement Object
                                (
                                    [name] => email
                                    [value] => 
                                    [type] => text
                                    [frozen] => 
                                    [label] => Your email:
                                    [required] => 1
                                    [error] => 
                                    [style] => 
                                    [html] => <input name="email" type="text" />
                                    [separator] => 
                                    [elements] => 
                                )
                                
                             ...

                        )

                )
                
            ...

        )

)

HTML_QuickForm::toObject() method uses the object renderer internally.