Archive for August 14, 2007

Rob Peck’s Blog: PHP Templating Celebrity Deathmatch!

The Code Lemur blog (as penned by Rob Peck) has a new post - a “deathmatch” for two of the PHP-associated templating solutions out there in a fight to the finish - Smarty and Blitz.

In this test, I am going to be comparing Smarty (the most widely used PHP templating engine and an official PHP project), Blitz (a new templating engine currently under very active development that is native compiled as a PHP extension), and standard PHP includes.

He compares them on three different levels - instantiation, simple template rendering, and complex testing. Each time, there’s a victor but in the end, there’s really only one “winner” - the PHP language itself that does a great job of templating things easily without the overhead of adding in external libraries.

PHP-Learn-It.com: Ajax Edit in Place

From the PHP-Learn-It.com website, there’s a quick tutorial on how to create a bit of edit in place functionality with some simple Javascript and PHP.

Suppose we have an article page on our site where people can edit articles. The article has an edit and save button which allows the user to edit the article and save the changes as necessary. View the ajax_edit_in_place demo to see what I’m talking about.

They’ve gone with Prototype to handle the AJAX connection and provide both the Javascript and PHP code for editing, saving and canceling an edit on the page’s content.

Ben Vinegar’s Blog: ActiveSupport for PHP - Ruby style

Ben Vinegar, having come from Rails to PHP was missing something - the ActiveSupport functionality Rails had natively that PHP doesn’t. So, he’s written up his own support for it and shares it in his latest blog post.

One of the things I miss most from Rails is ActiveSupport, the module that modifies Ruby’s core classes (numbers, strings, more) with handy utility methods. They tie so well into the language, most Rails developers don’t realize they aren’t core methods.

He starts with a Ruby example, showing how they work to show things like camelized strings, times and evaluations. Since PHP doesn’t support the same syntax, he had to work around it with some “PHP trickery” in PHP5 to handle it similarly. You can check out the results in the examples in his blog or by downloading the library and trying it out for yourself.

Zend Developer Zone: PHP and RIA (Presentation Update)

On the Zend Developer Zone, Andi Gutmans points out some updates they’ve made to their PHP and RIA presentation by adding some new functionality to an existing application originally by Padraic Brady.

For our presentation on PHP and RIA (PowerPoint Slides) Stas and I improved the chat application originally written by Padraic Brady and featured in the Ajax Chat Tutorial. We added a number of capabilities to show some of the more advanced concepts in the Zend Framework. You can download the application by clicking this link, Improved Ajax Chat.

Among the updates are things like a seperation of data handling, the addition of logging capabilities (including an interface to the logs allowing searching, etc) and integration with several web services. Also included in Andi’s post are instructions on how to get to these new features to check them out and what you’ll need to get it all up and running.

Symfony Blog: Top 20 symfony plugins

The Symfony project has posted a Top 20 list of the most accessed plugins for the framework, as based on their stats:

A quick look at the analytics of the symfony website tells us a lot about what people need in addition to the symfony core. Here is the top 20 plugins based on the number of page views of the corresponding wiki pages in the last 30 days.

Among those on the list are things like:

Check out the full list for other great plugins that made it into the Top 20.

Community News: Packt Publishing Releases “CodeIgniter for Rapid PHP Application Development”

Packt Publishing has just released one of their latest PHP-related books just for the frameworkers out there looking to get introduced to one of the easiest to use PHP frameworks on the web - CodeIgniter. The book, “CodeIgniter for Rapid PHP Application Development”, was written by David Upton director of a specialized management company. Here’s Packt’s official description from the press release:

This book explains how to work with CodeIgniter in a clear and logical manner. It is not a detailed guide to the syntax of CodeIgniter, but makes an ideal complement to the existing online CodeIgniter user guide, helping you grasp the bigger picture and bringing together many ideas to get your application development started as smoothly as possible.

[...] CodeIgniter for Rapid PHP Application Development is out now and is written for developers who are new to CodeIgniter. Basic skills in PHP and MySQL are required, but only rudimentary object-oriented knowledge is required.

You can purchase the book at your retialer of choice or you can get more information on the book itself from this page on the Packt Publishing website.

Brian Moon’s Blog: PHP Template tests (and Blitz)

Brian Moon points out a simple PHP templating application shown to him - Blitz:

A coworker of mine found out about a project called Blitz. its a PHP extension that does templating. It will of course have one advantage over Smarty. Smarty is slow as its all written in PHP. PHP is slower than C and always will be. Its just life.

Tests were even done to compare it to several of the other popular templating frameworks currently offered.

Felix Geisendorfer’s Blog: False == 0, or not?

Felix Geisendorfer has come across something interesting in his coding - an issue where false might not be false in the right situation.

So far I’ve always thought false would evaluate to 0 when used in a computational context. Turns out that this isn’t always the case.

His code example tries to check is a false value is greater than or equal to a negative number. The result, however (despite the thinking that false is a zero value) turns out to be false.

I randomly stumbled upon this when arguing with Mariano today if setting Model::recursive to ‘false’ has the same effect as setting it to ‘-1′. Turns out that cake uses a statement like this: if ($recursive > -1) in the core which in turn makes -1 and false do exactly the same thing.

Developing SOAP Clients using PHP

SOAP Simple Object Access Protocol provides a flexible communication layer between applications regardless of platform and location. As long as both the server and the client speak SOAP they can communicate. A PHP-based web application can ask a Java database application to get some information. In this article we will try to focus on different methods of developing SOAP web service clients in PHP….

Search Engine Strategies Summer - Register Today San Jose, CA - August 20-23 - Learn and network with the Internet Search Experts - our 9th Year

The Credence Blog: PHP frameworks - Which one is Most Suitable for you?

On The Credence blog, there’s a new article that’s looking to help you figure out which of the major PHP frameworks should be your weapon of choice when it comes to your next project.

PHP frameworks is the newest buzz word that is spreading the PHP community due to the threat posed by the famous Ruby on rails. Now everyone seems to look like working on such frameworks. The problem with this there is so many frameworks out there with different pros and cons that it is a hectic job to choose the right one.

They have a short list of frameworks, five of them - Symfony, Prado, CakePHP, the Zend Framework and CodeIgniter - and for each list out a few quick pros and cons for their use. Be sure to check out the comments for lots of other great framework-related comments as well.