Yii, Flash and XML

Hi there!

I have a Flash site with php admin. The php admin manages data that stores in a mysql database. Then the flash read this database trought a php script and xml. Database->php->xml->flash.

Ok. Now I want to do this with Yii. But I don’t know how to do. Inside the flash movie, calls to “/scripts/createxml.php” folder for example and returns the xml on the fly. But if my flash movie is in a view, where is this script? inside protected directory? in a action controller? on my root?..

Sorry for my english, and thanks.

I would put it in a controller action and return the XML with renderPartial.

Using Yii bulid-in database tools (either ActiveRecord or DAO) you can easily retrieve database contents (SQL query result) as associative array. You can then also quite easily (I hope so) convert this array to an XML.

Here you have some resources on this subject (converting PHP array to XML):

Though, I must admit that I haven’t tested them yet (I’m doing this right now)…