About the author: Daniel “Satyam” Barreiro is a specialist in YUI’s DataTable Control (and a capable generalist in most YUI-related issues). Satyam was a recipient of the inaugural 2008 YUI Community Award, recognizing his substantial contributions to the YUI project.
YUI is designed to be flexible so it can work in all sorts of environments. Sometimes we start from scratch, both on the client side and the server side, and we might get a little disoriented with so many possibilities. PHP or Rails? JSON or XML? In previous articles, I’ve shown how to use the DataTable Component and I’ve made some suggestions about how to manage the choices you have on the client.
A recent article at my web site offers techniques and sample code for the server side if it runs PHP scripts, which is a pretty common server-side choice for YUI deployments. It shows the code for several handy functions that make the server code easy to write. I begin by discussing a dispatcher function, ajaxReq which branches off to your individual responders, but not before setting the environment for a proper JSON reply. I also provide an ajaxReply function which makes it easy to produce the reply — for example, by simply passing it an SQL statement. I’ve recently updated ajaxReply to be able to produce replies suitable for the new YUI Get Utility. Finally, the function BuildSql is like a sprintf command designed for SQL, which makes it easy to build SQL statements with variables and can be used in any environment, AJAX or not.
If you’re using PHP with YUI, take a look — and feel free to leave feedback in the comments here.
March 5, 2008 at 6:27 pm
I am not a big javascript fan but have been learning prototype and scriptaculous, i have found a great php framework – cakephp.org, and have started working with YUI.
The cakephp framework allows for really easy implementations of just about anything and is worth a look for any php programmer – the core code is amazing – especially for newbie’s to learn from real world example.
March 6, 2008 at 1:55 am
Hi all,
I’m working on some coldfusion scripts that make it easier to use the latest version instead of the built-in ones with coldfusion 8 (and also you could use them on CF7)
As soon as I got something available for the public, I’ll post it on my blog.
Thanks again Satyam for your great work!
March 12, 2008 at 1:59 pm
I’ve just seen Nate Koechley cast and it was
totally worth it! I’ve been using yui css for few days and it really kicks a** :) Thanku you very
much guys, it’ll really help me at work.
ps. Try too leave longer comment with a bigger
font.
Gdańsk, Poland
Romek Szwarc
March 16, 2008 at 12:15 am
check out symfony, a mature php framework with plugins for the yui library among others.
to the credit of their developers, both yui and symfony are state-of-the-art, solid, mature, and enterprise-capable. they have a vast developer community and are actively supported by well-establish and reputable companies.
‘less is more’, or in other words, I have yet to find a need to use another javascript library to accomplish what I want to for the client interface. with yui 2.5.0 the list of goodies continues to exceed expectations. likewise symfony provides everything I need in a php framework. ruby-on-rails is good, but I found it’s config restrictions can be show-stoppers, expecially in the kind of sophisticated websites we develop. with symfony your config can be as limited as ruby-on-rails or uber-flexible without breaking the framework, and without breaking dry, rad, etc., principals.
‘all you need is yui’. maybe this can be turned into a song a la john lennon and placed on youtube.
another reason to use yui and symfony is the clarity and completeness of documentation. without proper documentation any library or framework becomes an expensive proposition as you spend more time ‘figuring it out’. with yui and symfony it is clear how to accomplish what you want. symfony goes as far as placing their published book online, free for all. no need to cough up $ to learn ‘the how’. Spend the $40-50 saved into your retirement account, more if you have a team of noobs hungry for yui and symfony knowledge. they ‘read-the-friendly-manual’ and stop bugging you.
April 1, 2008 at 11:00 pm
[...] My PHP Backend Scripts for Use With YUI » Yahoo! User Interface Blog [...]