Tuesday, July 03, 2007

Did you hear about Prado?



Since I started working with WebForms on ASP.NET, I knew that was the kind of web programing that I really want to do, people call it "event driven". Who cares about html tags if we have the viewstate and all the infraestructure that works on it...

When I started my practice time, I reached the PHP with Ajax using the Xajax framework, really nice times with such a nice framework (believe me, it's awesome) I couldn't stop telling my coworkers: ...it's kind of the code behind..., I make all my webpages with client events that fire server methods: using a couple of lines in javascript and the xajax engine, but ...

During the last two weeks I've been hearing about PRADO in my (then), future work place, PRADO ... it's a framework who won the Zend competition ... Let's check it out! ... Read about it on the web ... Oh, it's inspired in ASP.NET 2.0!!! so ... if it supports all of that beautiful stuff, could we program event driven websites with PHP transparently? ... The answer is Yes!!!

But the event driven part is not all of it. If you would like to work on software components (like I do) and do it the dotNet code-way (like I do), you will be pleased to find that PRADO is software component based, and provides:

A kind of using token (implement as a static method in a core class) to offset the lack of namespace in php:

Prado::using('This.Is.Del.I.Cio.Us.MyClass');

Properties with setter and getter methods:

class TControl extends TComponent {
public function getID() {
...
}
public function setID($value) {
...
}
}


used as:

$id = $component->ID;
$component->ID = $id;

or

$id = $component->getID();
$component->setID( $id );

Event:

$callback = 'myFunctionName'; or $callback = array($unsub,'myFunctionName');

$MyComponent->OnClick = $callback;
$MyComponent->OnClick->add( $callback );
$MyComponent->OnClick[] = $callback;
$MyComponent->attachEventHandler( 'OnClick' , $callback );

This is just the tip of the iceberg, PRADO is a UNIQUE framework, you should try it out. It doesn't support MVC, but it brings event driven to php in an easy an fun way.
If it's inspired on ASP.NET, how else could it be? :-)

Prado is here!

No comments: