Practical Web 2.0 Applications with PHP
Michael J. Ross writes "Web 2.0 applications and sites commonly employ a number of technologies: PHP, MySQL, XHTML, CSS, JavaScript/Ajax, microformats (standard formats for HTML data), tags (keywords for categorizing site content), and Web feeds (formatted and streamed Web content, usually in XML, such as an RSS feed). Because learning and using most of these technologies can be rather challenging to a Web developer, perhaps the best way to get started doing so is by using all of them to create a single Web-based application, with no pretense at mastering any one of them. This is the approach taken in Quentin Zervaas's book, Practical Web 2.0 Applications with PHP." Read on for the rest of Michael's review.
Practical Web 2.0 Applications with PHP
author
Quentin Zervaas
pages
569
publisher
Apress
rating
7/10
reviewer
Michael J. Ross
ISBN
1590599063
summary
An example-based guide to PHP and Web 2.0 technologies.
The book was published by Apress, on 20 December 2007, under the ISBNs 1590599063 and 978-1590599068. On the book's Web page, visitors can read and submit errata (apparently none, as of this writing), read the online table of contents, download Chapter 11 ("A Dynamic Image Gallery") as a PDF file, and purchase an electronic version of the book.
Given the number and complexity of the technologies discussed in the book, it is little wonder that it is 569 pages long. There is certainly a generous amount of material, and it is grouped into 14 chapters: planning and designing the sample application; application framework setup; user authentication, authorization, and management; user registration, login, and logout; Prototype and Scriptaculous; page styling using CSS; creating a blogging system; extending the blog manager; personalized user areas; Web 2.0 features (tags, Web feeds, microformats, and public profiles); the image gallery; site search functionality; integrating Google Maps; deploying and maintaining the site.
The first two chapters set the stage for the rest of the book. Chapter 1 provides a brief overview of Web 2.0, the sample Web-based application to be developed in the book, database connectivity, search engine optimization, PHPDoc, templating, and security, as well as the major features of the sample application, namely, a blog site. Chapter 2 describes how the reader can set up the application framework needed to follow along as the author explains how to build the sample application. This includes brief descriptions of how to install Apache, MySQL, PHP, and the Zend Framework. In fact, the book makes so much use of the Zend Framework that, after reading it from cover to cover, the reader will have gained a strong understanding of how some of the most popular components of that framework can be employed in their own projects. The chapter describes the file system structure the author has chosen, how to configure your Web server, how to set up the database, and how to connect to that database. It also provides an introduction to the Model-View-Controller (MVC) design pattern, as well as the Smarty template engine — both of which are used later.
While the introductory material in the first two chapters is essential — particularly to any inexperienced programmer — and generally spot on, some of the material could use a significant amount of expansion and clarification. For instance, in Chapter 2, the instructions on how to configure one's Web server, could easily prove confusing to most readers, because the author refers to the IP address 192.168.0.80, with no explanation as to what it is and how it relates to the usual local Web server address, 127.0.0.1 (localhost). His recommendation for a "hosts" file entry, "192.168.0.80 phpweb20," certainly does not help clarify matters. Furthermore, the author does not explain why "phpweb20" should be used instead of "localhost." In the subsequent discussion on virtual hosting and Linux, in a "Note," he mentions that the reader "must have previously included the NameVirtualHost 192.168.0.80 in your main Web server configuration..." In another note on the same page, he provides instructions on the PHP setup that should have been included earlier, in the section on installing PHP. In general, there are too many instances in the early chapters where key information is presented not where the reader would need it, but pages later. This can be especially exasperating to readers who are fairly new to the technologies, and are trying their best to follow the author's examples, every step of the way.
Chapter 3 discusses user authentication, authorization, and management. Unlike most PHP books, this one does not limit the reader to using MySQL as the relational database management system in conjunction with the sample application. The downloadable code for the book makes it possible for the reader to use PostgreSQL, even though the text itself focuses on MySQL. This flexibility is made possible by the author's use of the Zend_Db class. Admittedly of little significance, some of the book's SQL code looks a bit puzzling in some places. For instance, on pages 46-47, unneeded blank lines are contained within the "create table users" statement, with no reason given. Of greater importance, the chapter includes a short but valuable section describing the potential problems of date and datetime values in MySQL caused by server time zones, daylight savings, etc. — a topic well worth reading up on. The fourth chapter explores user registration, login, and logout functionality. Crucial topics such as password reset are covered, while some others, such as password strength, are not — no doubt due to space limitations.
Ajax is considered a central part of the new Web 2.0 trend, and for doing Ajax, the author recommends Scriptaculous, which is based on Prototype — both introduced in Chapter 5. The basic CSS styling of the sample application's Web pages, is covered in Chapter 6. The only flaw in the sample CSS code is that the author formats the declarations within each rule inconsistently, with some rules having multiple declarations on a single line, and others having each declaration on a separate line, which most people find easier to read and maintain. A highlight of the chapter is the author's comparison of the advantages and disadvantages to using a print-only CSS stylesheet versus a dedicated secondary print page — a topic not even seen in Web programming books that focus on design and CSS. The chapter concludes with a discussion of client-side form validation using JSON.
Chapters 7 through 13 focus much more on the sample application's functionality: implementing the user blogging system, and supplementing it with a blog manager index, Ajax capabilities, and a WYSIWYG editor (FCKeditor); creating user areas that can be customized by the users themselves; implementing the aforesaid Web 2.0 features (tags, Web feeds, microformats, and public profiles); implementing a dynamic image gallery, using GD for resizing, etc.; adding site search capabilities using Zend_Search_Lucene; incorporating Google Maps into the users' public blogs. All of these chapters are chock full of sample code, which the energetic reader may want to test out in their own development environments — particularly if they want to follow the author in creating the sample application. Fortunately, the reader will not have to waste any of that energy typing in code, because it can all be downloaded from the author's book site.
Specifically, Chapters 7 and 8 are devoted to the blogging capabilities of the sample application. While the discussion of permanent links, filtering, and the FCKeditor WYSIWYG editor may be of interest to a reader not implementing blogging themselves, the book at this point becomes more narrow in the information that it conveys — focusing even more on the code of the sample application. After reading through dozens of pages listing the code for blog entry management, readers may begin asking themselves, "Why not just use a CMS, instead of reinventing the wheel?" It should be borne in mind that the point of the book is not to advocate reinventing the wheel, but rather to show how a sturdy and reliable wheel can be built. Nonetheless, readers will need fortitude to plow through the many pages of code.
Despite the obvious expertise of the author, readers should be alert and open-minded to potential pitfalls. In the sample application's code, for generating passwords, the author uses only a hash function, md5(), despite its vulnerability to rainbow tables. The reader is advised to use an encryption function instead of — or in conjunction with — any hash function. The book contains another example of inattention to data security: In Chapter 4, as part of the user registration process, the user's password is e-mailed to the new registrant, naturally in plaintext, making it visible to anyone who intercepts the e-mail message. Years ago, all sorts of online organizations were following this lamentable practice; fortunately, "nasty grams" from security-savvy users seem to be turning the tide.
After exploring the possibilities of dynamic image galleries and Google Maps, the last chapter may appear relatively uninteresting to the reader, because it discusses application logging, error handling., and Web site deployment and maintenance, including backups. These topics may not seem too exciting, but failing to take the lessons to heart, and then experiencing a heart-stopping crisis on one's production site, will be the kind of excitement no Web programmer wants to experience.
What distinguishes this book from the majority of other PHP titles — for better or for worse — is that the author makes extensive use of specific frameworks and other tools, such as the Smarty templating engine and the Zend Framework, as well as classes that he has written, which are freely available in the source code. As a result, the value of the book to the reader is, to a certain extent, proportional to how much that reader wants to learn and possibly use those components. For example, if the reader chooses, for whatever reason, to not use the MVC design pattern and the Zend_Controller class for implementing MVC in their application, then the author's use of these will appreciably reduce the value of the book to that particular reader. In fact, given how lengthy Chapter 2 is, such a reader may mistakenly conclude that the rest of the book would be of no greater interest to them, and consequently become discouraged and quit reading. Other examples include the homebrew DatabaseObject and Profile classes, discussed in Chapter 3. Regardless, some readers may find that even if they do not use the author's chosen tools for their own applications, there is enough other programming and application-focused information that makes the book worthwhile to them. Other readers will be disappointed in the overall value of the book should they choose not to follow the author's recommended approaches. In addition, some programmers may be quite hesitant to base one of their own applications — particularly for paying clients — on classes created by a single developer, with no accompanying unit testing code to verify its soundness.
In terms of the production of the book, it is definitely up to par, with a font that is readable and yet small enough to get plenty of information on each page — in conjunction with the bottom margins being utilized better than in other books. However, at least for my particular copy of the book, several blocks of pages were cut with different widths, making it appear as if one or two blocks had become detached from the glue binding, when in fact they were all well attached. Within the binding glue, they were all attached at an equal depth, indicating that it was the cutting of the pages that caused the problem, and not how the blocks were set in the binding.
Even though some readers may find the book overly focused on particular frameworks and other tools, Practical Web 2.0 Applications with PHP is an instructive and expert demonstration of how to use PHP, MySQL, the Zend Framework, Smarty, Ajax, and other powerful technologies for creating robust Web sites.
Michael J. Ross is a Web developer, writer, and freelance editor.
You can purchase Practical PHP Web 2.0 Applications from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Given the number and complexity of the technologies discussed in the book, it is little wonder that it is 569 pages long. There is certainly a generous amount of material, and it is grouped into 14 chapters: planning and designing the sample application; application framework setup; user authentication, authorization, and management; user registration, login, and logout; Prototype and Scriptaculous; page styling using CSS; creating a blogging system; extending the blog manager; personalized user areas; Web 2.0 features (tags, Web feeds, microformats, and public profiles); the image gallery; site search functionality; integrating Google Maps; deploying and maintaining the site.
The first two chapters set the stage for the rest of the book. Chapter 1 provides a brief overview of Web 2.0, the sample Web-based application to be developed in the book, database connectivity, search engine optimization, PHPDoc, templating, and security, as well as the major features of the sample application, namely, a blog site. Chapter 2 describes how the reader can set up the application framework needed to follow along as the author explains how to build the sample application. This includes brief descriptions of how to install Apache, MySQL, PHP, and the Zend Framework. In fact, the book makes so much use of the Zend Framework that, after reading it from cover to cover, the reader will have gained a strong understanding of how some of the most popular components of that framework can be employed in their own projects. The chapter describes the file system structure the author has chosen, how to configure your Web server, how to set up the database, and how to connect to that database. It also provides an introduction to the Model-View-Controller (MVC) design pattern, as well as the Smarty template engine — both of which are used later.
While the introductory material in the first two chapters is essential — particularly to any inexperienced programmer — and generally spot on, some of the material could use a significant amount of expansion and clarification. For instance, in Chapter 2, the instructions on how to configure one's Web server, could easily prove confusing to most readers, because the author refers to the IP address 192.168.0.80, with no explanation as to what it is and how it relates to the usual local Web server address, 127.0.0.1 (localhost). His recommendation for a "hosts" file entry, "192.168.0.80 phpweb20," certainly does not help clarify matters. Furthermore, the author does not explain why "phpweb20" should be used instead of "localhost." In the subsequent discussion on virtual hosting and Linux, in a "Note," he mentions that the reader "must have previously included the NameVirtualHost 192.168.0.80 in your main Web server configuration..." In another note on the same page, he provides instructions on the PHP setup that should have been included earlier, in the section on installing PHP. In general, there are too many instances in the early chapters where key information is presented not where the reader would need it, but pages later. This can be especially exasperating to readers who are fairly new to the technologies, and are trying their best to follow the author's examples, every step of the way.
Chapter 3 discusses user authentication, authorization, and management. Unlike most PHP books, this one does not limit the reader to using MySQL as the relational database management system in conjunction with the sample application. The downloadable code for the book makes it possible for the reader to use PostgreSQL, even though the text itself focuses on MySQL. This flexibility is made possible by the author's use of the Zend_Db class. Admittedly of little significance, some of the book's SQL code looks a bit puzzling in some places. For instance, on pages 46-47, unneeded blank lines are contained within the "create table users" statement, with no reason given. Of greater importance, the chapter includes a short but valuable section describing the potential problems of date and datetime values in MySQL caused by server time zones, daylight savings, etc. — a topic well worth reading up on. The fourth chapter explores user registration, login, and logout functionality. Crucial topics such as password reset are covered, while some others, such as password strength, are not — no doubt due to space limitations.
Ajax is considered a central part of the new Web 2.0 trend, and for doing Ajax, the author recommends Scriptaculous, which is based on Prototype — both introduced in Chapter 5. The basic CSS styling of the sample application's Web pages, is covered in Chapter 6. The only flaw in the sample CSS code is that the author formats the declarations within each rule inconsistently, with some rules having multiple declarations on a single line, and others having each declaration on a separate line, which most people find easier to read and maintain. A highlight of the chapter is the author's comparison of the advantages and disadvantages to using a print-only CSS stylesheet versus a dedicated secondary print page — a topic not even seen in Web programming books that focus on design and CSS. The chapter concludes with a discussion of client-side form validation using JSON.
Chapters 7 through 13 focus much more on the sample application's functionality: implementing the user blogging system, and supplementing it with a blog manager index, Ajax capabilities, and a WYSIWYG editor (FCKeditor); creating user areas that can be customized by the users themselves; implementing the aforesaid Web 2.0 features (tags, Web feeds, microformats, and public profiles); implementing a dynamic image gallery, using GD for resizing, etc.; adding site search capabilities using Zend_Search_Lucene; incorporating Google Maps into the users' public blogs. All of these chapters are chock full of sample code, which the energetic reader may want to test out in their own development environments — particularly if they want to follow the author in creating the sample application. Fortunately, the reader will not have to waste any of that energy typing in code, because it can all be downloaded from the author's book site.
Specifically, Chapters 7 and 8 are devoted to the blogging capabilities of the sample application. While the discussion of permanent links, filtering, and the FCKeditor WYSIWYG editor may be of interest to a reader not implementing blogging themselves, the book at this point becomes more narrow in the information that it conveys — focusing even more on the code of the sample application. After reading through dozens of pages listing the code for blog entry management, readers may begin asking themselves, "Why not just use a CMS, instead of reinventing the wheel?" It should be borne in mind that the point of the book is not to advocate reinventing the wheel, but rather to show how a sturdy and reliable wheel can be built. Nonetheless, readers will need fortitude to plow through the many pages of code.
Despite the obvious expertise of the author, readers should be alert and open-minded to potential pitfalls. In the sample application's code, for generating passwords, the author uses only a hash function, md5(), despite its vulnerability to rainbow tables. The reader is advised to use an encryption function instead of — or in conjunction with — any hash function. The book contains another example of inattention to data security: In Chapter 4, as part of the user registration process, the user's password is e-mailed to the new registrant, naturally in plaintext, making it visible to anyone who intercepts the e-mail message. Years ago, all sorts of online organizations were following this lamentable practice; fortunately, "nasty grams" from security-savvy users seem to be turning the tide.
After exploring the possibilities of dynamic image galleries and Google Maps, the last chapter may appear relatively uninteresting to the reader, because it discusses application logging, error handling., and Web site deployment and maintenance, including backups. These topics may not seem too exciting, but failing to take the lessons to heart, and then experiencing a heart-stopping crisis on one's production site, will be the kind of excitement no Web programmer wants to experience.
What distinguishes this book from the majority of other PHP titles — for better or for worse — is that the author makes extensive use of specific frameworks and other tools, such as the Smarty templating engine and the Zend Framework, as well as classes that he has written, which are freely available in the source code. As a result, the value of the book to the reader is, to a certain extent, proportional to how much that reader wants to learn and possibly use those components. For example, if the reader chooses, for whatever reason, to not use the MVC design pattern and the Zend_Controller class for implementing MVC in their application, then the author's use of these will appreciably reduce the value of the book to that particular reader. In fact, given how lengthy Chapter 2 is, such a reader may mistakenly conclude that the rest of the book would be of no greater interest to them, and consequently become discouraged and quit reading. Other examples include the homebrew DatabaseObject and Profile classes, discussed in Chapter 3. Regardless, some readers may find that even if they do not use the author's chosen tools for their own applications, there is enough other programming and application-focused information that makes the book worthwhile to them. Other readers will be disappointed in the overall value of the book should they choose not to follow the author's recommended approaches. In addition, some programmers may be quite hesitant to base one of their own applications — particularly for paying clients — on classes created by a single developer, with no accompanying unit testing code to verify its soundness.
In terms of the production of the book, it is definitely up to par, with a font that is readable and yet small enough to get plenty of information on each page — in conjunction with the bottom margins being utilized better than in other books. However, at least for my particular copy of the book, several blocks of pages were cut with different widths, making it appear as if one or two blocks had become detached from the glue binding, when in fact they were all well attached. Within the binding glue, they were all attached at an equal depth, indicating that it was the cutting of the pages that caused the problem, and not how the blocks were set in the binding.
Even though some readers may find the book overly focused on particular frameworks and other tools, Practical Web 2.0 Applications with PHP is an instructive and expert demonstration of how to use PHP, MySQL, the Zend Framework, Smarty, Ajax, and other powerful technologies for creating robust Web sites.
Michael J. Ross is a Web developer, writer, and freelance editor.
You can purchase Practical PHP Web 2.0 Applications from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Since when is PHP practical?
PHP: Because 10 million newbies can't be wrong.
This is basically how I learned PHP. Without any PHP or mysql experience or even understanding the concept of a loop, I used tutorials from webmonkey.com and made cobbled together a weak CMS system over the course of a couple weeks. When I finished I immediately wanted to start over using what I'd learned.
Whale
A little off on a tangent, here. But I've never seen this addressed in any of these "Web 2.0" books. Has PHP ever introduced anything that is the equivalent of ASP.NET's "Master Pages"? That's one of the few innovations that I really liked about asp, and the last time I checked, php still didn't have anything quite like it (it was a godsend for me as a developer/designer).
SJW: Someone who has run out of real oppression, and has to fake it.
10 elitists simply can't be right
PHP is a language, ASP.NET is a framework (you can use different languages inside of it).
The question to ask is "Have any PHP frameworks introduced or adopted concepts like 'Master Pages'?".
Short answer is that I don't know. However, you'd need to look at things like symfony, codeigniter, cakephp, zendframework, and others. My guess is that no, those frameworks don't have any concepts like 'Master Pages', but I'm not an expert in those frameworks.
creation science book
Could you be a little more specific on that one?
SJW: Someone who has run out of real oppression, and has to fake it.
The reviewer suggests encrypting the password. Well, storing a hashed version of the password is at least a step in the right direction. Storing a salted hash is better, though. Encrypting that salted hash would be another level of security, although I don't think it'd buy you much more than salting it.
The Army reading list
Yet another guaranteed entertaining flamewar! Hey all you science, art, IT and politics geeks, let's all go watch the programmers burst a blood vessel over how much they hate PHP! It's guaranteed to be a great fireworks display! I got beer and pretzels, you all bring chips or cheezy poofs.
"All great wisdom is contained in .signature files"
When you're storing passwords, you almost never need the actual password anymore. What you need is a one-way function that can be used so when the user enters the password, the right bits come out (that match the original).
That may be md5, crypt, or whatever, but multiple methods are always better. And it has to be deterministic (ie: the password goes in, and the result is always the same).
If you do need the password later (because you need to stash it for enabling access to other systems), your options are pretty bad. One way or another someone will be able to extract that password, because if they have the database they probably have your source as well. However, since database access is more difficult to secure than your source code, it doesn't hurt to do a couple of transformations on the in-database passwords. You could base64/rot13 it, or do something that's relatively difficult to do in a high-level language (rotating the bits on a 3-byte chunk of the password 5 bites to the right comes to mind).
The big thing is you need to provide a reset mechanism. You can use a questions/answers format or an email link, but in the end users will always forget their password, the answer to their reset questions, and won't get your reset email, so have a process for your support person to reset a password.
Personally, I learned PHP over the years by creating simple web applications for various tasks and eventually because the web applications required more and more as they got more complex I was able to slowly and methodically work my way into a private framework I coded myself.
This book, like many other skips over this whole learning process. To really teach a language, any language, you have to explain why you do things as well as the goals.
I also don't like the fact that many PHP books attempt to half ass the teaching of installing LAMP on a LAN server location (localhost or otherwise). They should simply recommend some good hosts and explain the PHP.INI settings that might be of interest as they come up in the programming itself.
I like how they didn't even bother tagging this article with any of the useful tags, like say "php". Usually a new article starts with a few practical tags, then "slashdottagsmakemesmile" type things show up.
I guess this is the forward progression of Slashdot tags: no attempt at useful tags.
-- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
Say what you want about any language, any database, any scripting... but I have always said: if you have decided that you want to learn that language, then first find out what its capabilities are (do your best to understand their limitations), but come up with a big project that you want to do.
That is how I learned PHP, Javascript, and SQL simultaneously. I decided I wanted a web site that was database-driven and would stream MP3's. I knew what needed to be done, but I didn't always know how. I found people's examples on PHP.net very helpful, and went off on all kinds of tangents reading "Oh, hey if you have this situation, watch out for this...."
Now I can actually do stuff without having to look up function names all the time (though I still have to occasionally).
What did it get me? Well it got me off the telephone with a nice paying job that nearly doubled my salary, and to-date I'm about the best guy I know who does this sort of stuff. (Please don't take me wrong... I know there are people far more proficient at this than me; I'm not saying I'm the best -- just better than 90% of the industry out there, and I am creating useful things.)
I owe it all to that one project I decided to do.
"They said I probly shouldn't fly with just one eye," "I am Bender. Please insert girder."
i learned a lot of these Web 2.0 techniques by doing them myself on my own site. if you're trying to pick up on all this in cubicle-land, it's going to take a long time to get up to speed. things as simple as RSS feeds can be become quite complicated if you're using a huge legacy content management system. things like AJAX are hard to effectively introduce into a mature J2EE web app.
i knew nothing about RSS feeds, and after a quick read at google I was able to add RSS to my site and get it online in under half an hour. this is because my code is lean, and it's mine. there was no process to follow, no code reviews, no deployment scheduling. nothing, just me and a text editor.
sha1( (md5(string) + md5(5 char random salt)) ) That's all you will ever need ;)
There's plenty of frameworks out there specifically for separating content from layout. Just look in http://pear.php.net/.
I know nothing of ASP or its Master Pages, but when it comes to said separation, I favor HTML_Template_IT for its simplicity. For those who want a more "involved" templating system, there's things like Smarty, which I think doesn't quite have as strict a separation as I'd like.
I've been a web developer for about 12 years now, and have worked with .net, asp, php, CGI and so on over the years.
From my expierence of learning new languages and techniques as well as teaching others who are new to web development with such techiques as AJAX; learning off a full blown app with all the bells and whistles all ready added makes it difficult and even more challanging. Many times the code can be misleading and often confusing (most AJAX code I have worked with has been a nightmare) and can often lead to most people not learning but instead simply doing copy/paste of code snippets and simply relying on the fact of "this piece of code works with this form, it will work on this form also" type of mentality of programming.
Don't get me wrong; I am a firm believer that the best way to learn how to program is by trying pre-existing apps that are around to get your feet wet and to see things in action which many of the chapters in the book touch on (authenicating users, user logins) but for many people who are getting into programming IMO planning and designing and application frameworks are not the type of thing anyone should focus on first. How can you start to learn about designing a web application if you have had hardly any expierence with the language itself. And even more so with PHP as this is the gateway drug; er language many people are starting off with in their first step into programming.
TruePunk | Games
The concept is called templating and used to be called 'Server Side Includes' (somewhere around 1997 or so ... ). ASP, JSP and PHP are originally SSI languages / templating languages.
And if you want to use templating for your web developement - which is discussion worthy in itself - anything other that TAL (Pe(rl)-TAL, PHP-TAL or 'original' TAL is completely pointless, because the above mentioned languages are nothing but templating solutions in themselves. There is no point bolting another layer of that on top of them. Which is why I strongly dislike Smarty and it's ilk.
Oh, and I highly doubt that ASP has anything as neat and usefull as TAL. Do check out the OSS solutions, they're regarded as technology leaders in the field for a reason, which is one reason ASP & Co. are treated with suspicion.
We suffer more in our imagination than in reality. - Seneca
I believe what he is hinting at is the fact that PHP, unlike the ASP.NET framework, does not provide functionality on that level. Instead it is up to you to create that functionality, or use a framework where someone else created that functionality for you. Implementing the Master Pages feature in PHP would be a trivial task. You could recursively evaluate templates, capture their ouput, and place that output in the proper location on a parent template, or you could composite the entire thing into one template and then evaluate it. With PHP this kind of implementation detail is under your full control.
Perhaps if learning and using those technologies is 'challenging' to a web developer, that person should be 'developing' a new career.
When is someone going to write a book on how to make good websites?
but I'm fairly sure Slashdot runs on Perl.
In Soviet Russia, MSDN navigates you!
PHP sucks, but none of its problems are showstoppers. You do have to look up every strwtfbbq function to check needle/hastack order and if someone decided to throw in underscore for a good measure, but after you do that (and go through three dozen application-breaking retarded configuration options) it works, works well enough and scales nicely on loads of different systems and servers.
The error handling alone disqualifies it. Its a great idea horribly implemented. If there is no other solution, take the pear lib you need and divorce it from any pear references. It will make your life a lot easier.
just show me a reason for the '2.0'. all this buzz, and yet for what reason ?
Read radical news here
I disagree re: navigating MSDN to find classes and methods for .NET ... when I was coding with .NET, I always had Reflector open for navigating our own libraries, as well as the .NET ones.
.NET and PHP have shells too - which I always use whenever I code with them. I always used Booish in .NET (Boo's interactive console). For PHP, I use phpsh. Ofcourse, for .NET, you should use Powershell ... but I hate, hate, hate it.
:)
.NET, we offered all of our programmers the choice to code in whatever they wanted. Most people used VS, but someone used Eclipse, and I used vim. You don't NEED VS to code .NET. I was happy with vim + NAnt ( + Reflector + Booish ).
Now, whenever I code in PHP, I'm often on php.net and I *HATE* it.
One of my favorite things about Ruby is how sweet the reflection is and how ridiculously easy it is to look for objects or grep method names, etc, in IRB.
That said,
But, in my opinion, nothing beats how easy it is to navigate objects / scope in Ruby. Hell, you could alias a method to print its local_variables and instance_variables before returning. You can eval in the scope of any of your objects, to peek in and see what's what. It's yummy.
P.S. While I, too, had many headaches getting new users up and running with
PHP-TAL is the same as Smarty just with a different syntax.
Wrong.
TAL (Template Attribute Language) stores it's signals in it's own tag attributes. Hence the name. This means you can build a template filled with mock-content that renders perfectly in any browser without the SSI enviroment and as soon as you integrate it into the templating layer the demo content is automatically replaced by the generated content. A feature pure PHP, JSP, ASP, whatnot code definitely can't provide.
That template processing - and thus TAL - comes with a performance price isn't news - in fact it's the second largest showstopper for templating in general. But apart from all other templating concepts, at least TAL isn't entirely pointless, as it actually adds non-existing functionality to your pipeline, where as Smarty, YATS, PatTemplate and whatnot just add yet another layer of allready existing functionality to a system using their own syntax. The classic 'Inner Plattform' Anti-Pattern.
We suffer more in our imagination than in reality. - Seneca