7.25.2006
XForms cometh to PHP ! Throw out HTML_Quickform?
PHP Architect has an article in their June 2006 issue about using XForms within PHP5. If you don’t know what XForms is/are, you’d better look into it. It’s basically a way to describe forms on your page and all the data validation rules entirely in XML. The form presentation and validation capabilities of it are kind of like HTML_Quickform on crack.
Of course, there’s always a rub. No browsers natively support XForms. The article in PHPArch uses the FormFaces JavaScript to get things to work. But I don’t like the way FormFaces comes off. They tout both a GPL license and a commercial one but then they mask the JavaScript so you can’t extend it or see how it’s actually working. That smells like a temporary GPL license to me.
So, I don’t think you could do XForms on the client side just yet. It’d be nice if someone would step up and create a server-based solution for XForms in PHP. Maybe I’ll do that myself. In the meantime though, the Quickform folks are already busy planning HTML_Quickform2, a PHP5 version of their form production code. That will have to do for now I suppose.
7.22.2006
Smarty not so smarty in PHP5. Try XSLT instead.
So I’ve been working on this pretty big migration project lately, from PHP4 / MySQL 4 to PHP5 / MySQL5. It’s even larger because we’re moving from a largely procedural code base to using objects with inheritance and a lot of composition.
So what’s all that have to do with Smarty? Well, all our PHP devs are busy getting familiar with the framework I’ve built for the project. So, that leaves some HTML gurus and ASP folks sitting around under-utilized on this project. Ideally, I’d like the PHP folks to work on the backend stuff and then have an HTML or ASP dev take care of the views.
Of course, if the templates are all done in Smarty that means these folks have to possess not only a decent understanding of PHP, but also thorough experience with Smarty templating. These skills are a bit of a reach for the HTML folks… and the ASP people will mostly just protest because they’d have to learn PHP stuff AND develop on a Linux box. ;-)
Enter XSLT. Most developers in other languages use XSLT already (ASP, .NET, JSP, etc). I’ve never understood why it’s so slow to catch on with PHP. Perhaps because the XML tools in PHP4 were so poor?
So if the ASP folks already know XSLT, and the HTML folks don’t yet, but can learn a templating skill that is basically development-language-agnostic, I think it’s a win-win-win situation.
I’ve thought this way for a long time but this project has really crystallized my take on it. Developers at any level should strive to learn tools and techniques that can be universally applied to other languages. You may be a PHP programmer today, but you might be something else tomorrow.
So what’s all that have to do with Smarty? Well, all our PHP devs are busy getting familiar with the framework I’ve built for the project. So, that leaves some HTML gurus and ASP folks sitting around under-utilized on this project. Ideally, I’d like the PHP folks to work on the backend stuff and then have an HTML or ASP dev take care of the views.
Of course, if the templates are all done in Smarty that means these folks have to possess not only a decent understanding of PHP, but also thorough experience with Smarty templating. These skills are a bit of a reach for the HTML folks… and the ASP people will mostly just protest because they’d have to learn PHP stuff AND develop on a Linux box. ;-)
Enter XSLT. Most developers in other languages use XSLT already (ASP, .NET, JSP, etc). I’ve never understood why it’s so slow to catch on with PHP. Perhaps because the XML tools in PHP4 were so poor?
So if the ASP folks already know XSLT, and the HTML folks don’t yet, but can learn a templating skill that is basically development-language-agnostic, I think it’s a win-win-win situation.
I’ve thought this way for a long time but this project has really crystallized my take on it. Developers at any level should strive to learn tools and techniques that can be universally applied to other languages. You may be a PHP programmer today, but you might be something else tomorrow.
7.17.2006
Functionality of the PHP trim command I bet you did not know
trim
(PHP 3, PHP 4 , PHP 5)trim -- Strip whitespace from the beginning and end of a stringDescription
string trim ( string str [, string charlist]) You can also specify the characters you want to strip, by means of the charlist parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters. Example:$strComma = "item 1, item 2, item 3,"; echo trim($strComma, ',');
7.13.2006
Best... Typo... Ever...
From: Sysadmin
Subject: Server auto logout
FYI Interactive logins on all unix machines will now automatically timeout after 1 hour of inactivity. If you are running a long-running job/script, this will be unaffected if it runs past an hour. If you are just shitting at a shell prompt, and haven't typed anything in an hour, you will be logged out. Feel free to pass this on to anyone else I may have missed.
Subscribe to:
Posts (Atom)