Class Scheduler - XML Generator for DHTMLX
$scheduler = new Scheduler( set encoding, default utf-8 )
$scheduler = new Scheduler;
or
$scheduler = new Scheduler('iso-8859-1');
$scheduler->event( array( 'key attribute' => 'value attribute' ) )
$scheduler->event(
array(
"id" => 1,
"start_date" => "2009-05-24 00:00:00",
"end_date" => "2009-06-08 00:00:00",
"text" => "French Open",
"details" => "Philippe-Chatrier Court Paris, FRA"
)
);
$scheduler->header()
$scheduler->header();
return
header("Content-type: application/xml; charset=utf-8");
$scheduler->result()
echo $scheduler->result();
Print XML
<?php
include_once 'DHX.php';
$scheduler = new Scheduler;
$scheduler->event(
array(
"id" => 1,
"start_date" => "2009-05-24 00:00:00",
"end_date" => "2009-06-08 00:00:00",
"text" => "French Open",
"details" => "Philippe-Chatrier Court Paris, FRA"
),
array(
"id" => 2,
"start_date" => "2009-06-10 00:00:00",
"end_date" => "2009-06-13 00:00:00",
"text" => "Aegon Championship",
"details" => "The Queens Club London, ENG"
),
array(
"id" => 3,
"start_date" => "2009-06-20 00:00:00",
"end_date" => "2009-07-18 00:00:00",
"text" => "Wimbledon",
"details" => "Wimbledon June 21, 2009 - July 5, 2009"
)
);
$scheduler->header();
echo $scheduler->result();
?>
Result
<?xml version="1.0" encoding="utf-8"?>
<data>
<event id="1">
<start_date>
<![CDATA[ 2009-05-24 00:00:00 ]]>
</start_date>
<end_date>
<![CDATA[ 2009-06-08 00:00:00 ]]>
</end_date>
<text>
<![CDATA[ French Open ]]>
</text>
<details>
<![CDATA[ Philippe-Chatrier Court Paris, FRA ]]>
</details>
</event>
<event id="2">
<start_date>
<![CDATA[ 2009-06-10 00:00:00 ]]>
</start_date>
<end_date>
<![CDATA[ 2009-06-13 00:00:00 ]]>
</end_date>
<text>
<![CDATA[ Aegon Championship ]]>
</text>
<details>
<![CDATA[ The Queens Club London, ENG ]]>
</details>
</event>
<event id="3">
<start_date>
<![CDATA[ 2009-06-20 00:00:00 ]]>
</start_date>
<end_date>
<![CDATA[ 2009-07-18 00:00:00 ]]>
</end_date>
<text>
<![CDATA[ Wimbledon ]]>
</text>
<details>
<![CDATA[ Wimbledon June 21, 2009 - July 5, 2009 ]]>
</details>
</event>
</data>
Lucas Tiago de Moraes