Lerdorf’s No-Framework PHP MVC Framework
Some years ago, Rasmus Lerdorf, original creator of PHP, posted on his personal Web site a discussion of what he would look for in a framework for the MVC architecture. It’s an interesting read, from the master’s voice. He specifically talks about how to properly use MVC, how to guarantee performance and security, and how to design with scalability and flexibility in mind. Although the post is a few years old, most of it is still valid, although there are little changes such as the fact that the PECL/Filter extension is now part of PHP proper.
Lerdorf also posted his own thoughts on Facebook’s use of HipHop PHP for faster PHP execution, if you’re looking for something to read.
Adobe Flex 5 Adding Mobile Features
Somewhat ironically, considering the recent spat between Adobe and Apple, the next major version of Flex, codenamed “Hero”, will have specific support for developing Flash applications intended for mobile devices. Accomplishing this involves both adding new components and skins as well as making some modifications to existing components. Although Flash content can already run on some mobile devices, the smaller screen sizes can have unfortunate consequences. This new version of Flex, due out in beta version later this year, will address that issue by allowing for smarter scaling of the application’s size.
Using Flash with Yii
On my most recent Yii-based Web site, I decided to use a custom Flash application for part of the back-end administration of the site. The justification was simple: what the administrator needed to do was a bit complicated; lots of information had to be available but the user interface had to remain uncluttered and natural. The specific Web site provided a way to create and take online quizzes. In a separate process, the administrator could add and edit questions. In the Flash-based process, the administrator could associate any number of questions with a quiz (actually, a pool of questions would be associated with a quiz and X number of random questions would be pulled from that pool). The main issue, from a user interface perspective, was how to display the questions in an intelligent way. With other examples, I might create a form for adding or editing quizzes and within that form, the questions would be listed within a dropdown menu (actually a SELECT menu that displayed and allowed for the selection of multiple options). However, with this particular example, there was no good way to display the questions in a SELECT menu. Each question had a unique primary key, of course, but that’s not very useful to the administrator. The questions did not have unique names (what name do you give a question?) and the best indicator of a question was its prompt, which would be HTML, possibly containing images and videos. So, again, how do I display possibly hundreds of questions in a meaningful way?
My solution was to show the list of questions by number and, when the admin clicks on a specific question, they’d see a preview of that question’s prompt (i.e., the HTML) in a separate interface. Now I’ve got three areas in my UI: one for adding or editing the other quiz attributes, one for listing every question, and a third for displaying the particulars of a single question. Given all this, I thought having the admin drag the questions from one area to another would be the best way to associate a question with a quiz. I could have done all this using jQuery (the JavaScript framework Yii uses by default), but that would have taken me days to figure out how to use jQuery in this way. On the other hand, I knew I could develop this using Flex (a framework for creating Flash applications) in no time. I just didn’t know how to get Yii and Flash to play ball. It turns out not to be that hard…
You Don’t Know Anything About Regular Expressions: A Complete Guide
I recently StumbledUpon the article You Don’t Know Anything About Regular Expressions: A Complete Guide at Nettuts+. It’s geared towards using Perl-Compatible Regular Expressions (PCRE) in JavaScript, but is useful enough and accessibly written that many might benefit from checking it out. The tutorial starts off with the basic syntax and characters, but then runs through five videos showing their use in action. The rest of the tutorial, which is largely JavaScript code, outlines how you can parse email addresses and URI’s using regular expressions.
Really Useful Tools For PHP Developers
I recently StumbledUpon an article on Really Useful Tools For PHP Developers at W3Avenue. The article doesn’t go into too many details, let alone provide specific instructions for any of the tools, but it’s nicely organized and presents a good list of useful PHP-related tools. The list ranges from development software to security utilities to packages that will simply format your PHP code in a definitive style. Check it out if you’re a PHP developer; there are always new ways to make your work easier and the output better.