Wednesday, November 15th, 2006
Tigermouse PHP/Ajax Framework
Michal Slaby has created a new PHP/Ajax framework called Tigermouse.
Tigermouse is an object-oriented, event driven, MVC architecture based framework. Its goal is to take care of View and Controller part of the application, but there is also a very basic support for your Model. It encapsulates Javacript callbacks so you don't have to write your own Javascript functions (unless you really want to).
Tigermouse abstracts out XMLHttpRequest and Javascript callbacks so you don't play with them directly, and have no need to mix Javascript and PHP. The decision on which callback to call is being made at the server side instead of client side, after, not before you know the result of server side processing. There is also no function registering for binding PHP and Javascript functions together. Instead, you can call any public method you wish using path-like strings.
Example
Template
Controller
-
-
<?php
-
class MainCtrl extends Ctrl {
-
-
public function show() {
-
$f = new Form('loginForm');
-
$f->template = 'app/LoginForm.tpl';
-
-
$l = new Input('login');
-
$p = new Input('passwd');
-
$ok = new Button('ok');
-
$ok->text = 'Login';
-
-
$f->add($l);
-
$f->add($p);
-
$f->add($ok);
-
$ok->addListener('onClick', 'LoginCtrl/auth', $f->valueReader());
-
-
return $f;
-
}
-
-
}
-
?>
-
-
<?php
-
class LoginCtrl extends Ctrl {
-
-
public function auth(FormContext $cx) {
-
$f = ActionService::execAction('MainCtrl/show');
-
-
if ($cx->login) {
-
$this->response->eval($f['login']->errorMessage("You do have name, don't you?"));
-
return;
-
}
-
-
$l = new Label('loginForm');
-
$l->text = "Hello {$cx->login}. I see you password is {$cx->passwd}. That's nice.";
-
return $l;
-
}
-
-
public function show() { }
-
-
}
-
?>
-












zx
asldkjfas
Well Tigermouse Proyect is goin up. new version in http://sourceforge.net/projects/tigermouse/ is able. Many example in my web page http://pablim.homelinux.com
I’m trying to learn Tigermouse and i want to teste your example, but…. i’m using microsoft windows and i don’t know how to setup it and how to integrate it with php. could you tell me how? i’v tried at Tigermouse site’s but i haven’t found.