Thursday, March 6th, 2008
To ExtPHP, or to PHP-Ext?
<>p>I got emails on the same day from two developers letting me know about ExtJS wrappers for PHP.PHP-Ext
First, Sergei Walter Guerra told me about PHP-Ext "an open source widget library written for PHP 4 and 5 to empower the UI Layer."
The API looks like this:
-
-
Javascript::stm(ExtQuickTips::init()),
-
Javascript::assign("data",Javascript::valueToJavascript($myData)),
-
//Javascript::valueToJavascript($myData),
-
$store->getJavascript(false, "ds"),
-
$italicRenderer,
-
$changeRenderer,
-
$pctChangeRenderer,
-
$colModel->getJavascript(false, "colModel"),
-
$gridForm->getJavascript(false, "gridForm")
-
);
-
-
$gridForm = new ExtFormPanel("company-form");
-
$gridForm->Frame = true;
-
$gridForm->LabelAlign = EXT_FORM_LABEL_ALIGN_LEFT;
-
$gridForm->Title = "Company Data";
-
$gridForm->BodyStyle = "padding: 5px;";
-
$gridForm->Width = 750;
-
$gridForm->Layout = EXT_CONTAINER_LAYOUTS_COLUMN;
-
ExtPHP
Then Chris Ravenscroft came to me to announce ExtPHP:
"It is something that I had to think about in my day job, because my team is migrating to PHP for web development and I believe that we simply do not have enough time for them to learn JavaScript's intricacies, I needed to be the one person who would have to wrestle JavaScript when problems happened. I therefore needed a way to insulate them from the gory details, which is why I created ExtPHP."
The API looks like this:
-
-
$cfg = new Ext_Viewport_Config();
-
$viewport = new Ext_Viewport(
-
$cfg->
-
layout('border')->
-
);
-
$viewport->jsrender();
-
-
$tabpanel->add(
-
'closable'=>true
-
)
-
);
-
-
new JsReady(JsWriter::get());
-
Maybe you guys can join forces? :)








Although these kinda Projects are great i still feel that you end up restricting the power of ExtJS.
It took me just short of 48hrs to get to grips with ExtJS and I hate JavaScript :) but ExtJS has made me grow to love it.
Check out that syntax. Is that any easier than javascript itself?
Time for a paradigm shift towards simplicity and semantics.
@LFRed
It might not be easier then javascript syntactically, however it does allow the developer to keep their code organized in a single location and language. I’ve been working on a php/Extjs project for some time now, and have thought about doing this myself (creating a php wrapper class).
i’ll have to look at exactly how these classes are implemented, but it might be useful. Also it will help to a AJAX project form less skilled developers who dont know how to code in javascript or can’t get a handle of an event driven, functional language.. so until i can hire the developers i’ll be taking a look at this project.
For Symfony (the PHP5 Framework ;-) ) there is also a nice ExtJS wrapper-plugin.
You can check it out at: http://trac.symfony-project.com/wiki/sfExtjs2Plugin
it can be used with a symfony ExtJS-theme plugin which transforms the default admin-CRUD-pages from Symfony to ExtJS powered ones (although this is still work in progress)
http://trac.symfony-project.com/wiki/sfExtjsThemePlugin
We all know coolite.com , a tool for asp.net to graphically use ExtJs widgets without javascript, but It’s generating javascript.
I believe some one must start working on a plugin for eclipse to add the same functionality as coolite, so there’s no need for a wrapper and also we won’t hand code some thing related to UI, but we’ll use them this way easily.
This wrappers like pQuery, ExtPHP will degrade performance vs clean JS. And destroy all business-logics. No reason to use it, only for learning “wrapping” =)
I agree with Luerssen.
But how nice Ext for admin side!
I’d completely disagree with Luerssen, that type of argument is like saying don’t code C++ cause the generated binary is degraded compared to coding pure assembler – additionally ALL business-logics should be implemented server, doing anything remotely business critical client side is asking for problem!
I think a nice blend of wrappers and JS makes for a better development environment. I love EXTJS and continue to use it every day in development but I find that I need to dynamically generate JS code based on business logic. This is hard to do in EXTJS when you have a large code base and a very dynamic business logic setup. Most of the development we do the EXTJS is not static and the use of a wrapper class makes for a cleaner code base.
Mostly I use the Wrapper for AJAX classes where PHP preforms the server back-end.
I see this is an old post, however I thought I’d share another alternative which is in development.
I’ve been developing this, to reduce the amount of code required to create a UI and to drop the idea of using onReady and stuff like that as seen in PHP-Ext …
A sample can be seen here:
http://www.davegoodchild.co.uk/library/
I’ll be aiming to complete this and get it out there for folk to try….The grid stuff has been simplified further than what is currently there.
Regards,
Dave.