Class Combo Documentation

Description

Class Combo - XML Generator for DHTMLX

construct

$combo = new Combo( set encoding, default utf-8 )

    $combo = new Combo;

or

    $combo = new Combo('iso-8859-1');

attributes

add

    $combo->add = "true";

option

$combo->option( array( 'key attribute' => 'value attribute' ) )

    $combo->option(
        array(
            "value" => 1,
            "css" => "font-weight:bold;",
            "text" => "One"
        )
    );

header

$combo->header()

    $combo->header();

return

    header("Content-type: application/xml; charset=utf-8");

result

$combo->result()

    echo $combo->result();

Print XML

Examples

Example 1

    <?php
    include_once 'DHX.php';
    
    $combo = new Combo;
    
    $combo->option(
        array(
            "value" => 1,
            "css" => "font-weight:bold;",
            "text" => "One"
        ),
        array(
            "value" => 2,
            "text" => "Two"
        ),
        array(
            "value" => 3,
            "img_src" => "some.gif",
            "text" => "Three"
        ),
        array(
            "value" => 4,
            "cdata" => "<strong>four</strong>"
        )
    );
    
    $combo->header();
    echo $combo->result();
    ?>

Result

    <?xml version="1.0" encoding="utf-8"?>
    <complete>
        <option value="1" css="font-weight:bold;">One</option>
        <option value="2">Two</option>
        <option value="3" img_src="some.gif">Three</option>
        <option value="4">
            <![CDATA[ <strong>four</strong> ]]>
        </option>
    </complete>

Author

Lucas Tiago de Moraes

Support

Group DHTMLX Facebook