Developer Version

For effectively developing widgets developers need to download and install Developer Version of the framework. Developer version is a simplified version of MyWeb's core.

Developers will find all necessary API - s that are required for creating fully functional widgets. Developer version consists of following parts:

Please read documentation carefully before beginning widget development.

System Requirements

To begin widget developments developers need to satisfy minimal system requirements. Read details below:

  • Any operation system
  • Apache web server of any version
  • PHP of minimum version 5.2.3
  • Latest version of Zend Optimizer
  • Any editor for coding (Eclipse is a good candidate)
  • Any modern web browser (FireFox + FireBug is preferred during development)

Installing Developer Version

First of all you need to download developer version of MyWeb: mywebdev.zip. Installation is simple and requires zero configuration. You just need to extract downloaded zip file into your local webserver's root directory.

Note that developer version is intended for development purposes only, thus it will work only on localhost under "mywebdev" folder. Widgets will be accessible through http://localhost/mywebdev/

After installation you will see file structure shown on the picture below:

Thats it, installation and configuration are completed. Now you can begin development of a widget. First of all open “index.html” file(look at the selected file on the picture above). This is entry point where developers can load and test widgets on demand, without any further configuration. Lets look of the file structure:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="udw/assets/styles/style.css"/>
    <script type="text/javascript" src="udw/js/udwdev.js"></script>
</head>
<body>
 
 
<!-- target container where widget will be inserted -->
<div id="w1"></div>
 
<script type="text/javascript">
 
loadWidget(
    {
        widget: 'googlesearch', 
        target: 'w1', 
        style: 'white'
    }
);
 
</script>
 
</body>
</html>

This file contains all required script and style includes that are required for loading and running widgets. Only part worth of mentioning is “loadWidget()” JavaScript function that is invoked for loading actual widgets. It requires one parameter with structure shown below:

Key name Description Required
widgetName of the widget to be loadedYes
targetID of the target HTML element where the loaded widget will be insertedYes
styleInitial style of the widget. You can choose from white, blue, red, yellow or greenNo

For example for loading “helloworld” widget you need to write following code:

loadWidget(
    {
        widget: 'helloworld', 
        target: 'w1', 
        style: 'white'
    }
);

Please note that "loadWidget()" function call must be placed after target HTML element, otherwise behavior of widget loader is not predictable. Also it is important to mention that you don't need to load widget's JavaScript and/or CSS files explicitly. These tasks will be performed by widget loader.

For further information and details on widget development please visit following documents: