You are here: Docs Example Code Simple Registered Web Widget

Simple Registered Web Widget

This very simple sample demonstrates how a web widget, in this case a simple PHP file, can be registered with the Clearspring platform, and therefore given additional capabilities. Unlike when using the kernel, this sample illustrates the widget loading in the Clearspring Container.

Download Now

Concepts Demonstrated

This sample demonstrates:
  • A simple web widget being given the Get & Share menu and its viral sharing services with no programming
  • Accessing context information that is passed from Clearspring's servers into the widget
  • Accessing values for specified configuration parameters
  • Getting basic access to the In-Widget Services API

Prerequisites

you can view the source in any text editor. To run it yourself, you'll need to have a web server with PHP capabilities. If you are not familiar with PHP, don't worry, as the sample is quite simple and the PHP-specific functionality is minimal.

Using the Sample

To fully-demonstrate the sample on your own, just place the PHP file on a PHP-enabled web server and register it as a web widget with the Clearspring platform. For full functionality, you should configure parameters var1-var4, and turn on the server-side context settings, all in the widget console. If you just want to view the live sample in this page, you can do that as well.

The Sample In Action