Working with Microsoft Silverlight on PHP
Microsoft Silverlight, now at version 3.0, is a great way to create rich web applications that run on Windows, Mac OS and Linux. It provides an engaging, rich, safe, secure, and scalable cross-platform experience. Best of all you can run it off any web server (IIS, Apache for e.g.) and it can be called from any PHP website! Our team has released some helper samples to get you started. You can find the project on the Samples for PHP with Silverlight web page, and the project source can be found on Codeplex. The project includes sample HTML and PHP scripts.
How it works? Silverlight content is embedded into an HTML or PHP web page and in turn is transferred to the client browser where it is displayed by the Silverlight runtime (plugin) installed on the client computer. The architecture is shown on the right.
You will first create a Silverlight application file (.xap). We have provided a sample file, HelloPHPDevelopers.xap within the download or you can also create one for yourself by using another tech bridge we have, Eclipse Tools for Silverlight. Our colleague Steve Sfarz in France has a great post up on his site describing how to get started with it and create your own .xap file. This file is essentially a packaged archive or .zip file (try changing .xap to .zip and browse into it) with a collection of libraries that you have compiled for your application. If you follow the directions on the site you will end up with a button on a form with some custom actions.
You will then copy the .xap file you have created to a directory within your web site where you plan to host the Silverlight content. You will then want to create a custom HTML or PHP page that includes the following code in it’s body