Hello,

I am currently thinking about a php framework dedicated to web applications 
with rich client interfaces using AJAX.
The goal of this framework is to provide the possibility to write rich web 
applications using a syntax similar to wxWidgets or .NET.

An example is better than a long story :

<?
require_once('widget.php');

class myForm extends Form {
        public function __construct(){
                $this->Title = 'Main Window';

                $button = new Button();
                $button->Title = 'A test Button';
                $button->OnClick = 'buttonOnClick';
                $this->AddControl($button);
        }
        public function buttonOnClick(){
                MessageBox::Show('Hello, World !');     }
}

Application::$Title = 'Widget Demo';
Application::Run(new myForm());
?>
With this example, you can have an idea of how this would work.
In this case, Application::Run() creates a context on the client (IE, 
Firefox...) where AJAX is easily useable. It also renders the interface, 
using xhtml/css code specific to the navigator used by the client (Specific 
code for IE incompatibilities, for example).

Button->OnClick is a public member of a class Button. It is similar to a 
delegate (or function pointer). Its job is to write code into the onClick 
javascript event of the button.
When the button is clicked, an AJAX call is performed on the server, 
requesting the execution of the handled code, in this case : 
myForm->buttonOnClick().

MessageBox::Show() is defined in the php framework and calls a javascript on 
the client that draws a messagebox containing a message.



As you can see, the idea is pretty simple : imitating wxWidgets/.NET to 
delegate xhtml/css and AJAX to the framework. So the programmer can totally 
focus on his work.


I was wondering if such a framework already existed and also was wondering 
about the real usefulness of something like this. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to