In a new post to his blog Matthew Weier O'Phinney shares a simple publish-subscribe system he's created based on a feature of the Dojo toolkit using the Zend Framework to create an easy notification architecture.
The system has elements of Aspect Oriented Programming (AOP), as well as the Observer pattern. Its power, however, is in the fact that an individual object does not need to implement any specific interface in order to act as either a Subject or an Observer; the system is globally available.
The script creates an object that publishes an event. This event then sends off messages to all of the other objects subscribing to it. A code example is included. You also can check out the code from its page on github (as a part of his Phly libraries) and play with it yourself.
Matthew Weier O'Phinney has put together a guide to answer some of the questions he's been getting about combining the Zend Framework and Dojo functionality for autocompletion.
I've fielded several questions about setting up an autocompleter with Zend Framework and Dojo, and decided it was time to create a HOWTO on the subject, particularly as there are some nuances you need to pay attention to.
He shows how to set up the correct Dijits and how to create the default form element in a Zend_Form instance. He creates a data store and a QueryReadStore to hold the information. The then modified that default Zend_Form element (a ComboBox) to include the storeType and storeParams for these instances.
Matthew Weier O'Phinney has made some updates to his pastebin example showing the combination of the Zend Framework and Dojo libraries.
I've been getting a lot of interest in my Pastebin demo app -- partly by those wanting to play with Dojo+ZF, partly by those just interested in the application. [...] I've created a Github repository so you can track the latest developments, as well as pull custom tarballs.
The demo application was a part of Matthew's Zend Framework & Dojo webinar from Zend.
Zend made several announcements in the opening keynote of this year's Zend/PHP Conference & Expo
including collaborations with Adobe, IBM and the Dojo project to further PHP's place in the online
development community.
These announcements pertained to partnerships with these other companies on projects like bringing
out-of-the-box Ajax functionality to the Zend Framework with Dojo and updates to the Zend Core and
Zend Studio software. Also announced was the release of a new certification specifically for the Zend
Framework - "Zend Certified Engineer for Zend Framework".
One of the major announcements, though, was Zend's efforts with Adobe to help make the connection
between their powerful Flex environment and what PHP has to offer. The key to the integration lies in
the AMFPHP (Action Message Format) tool that acts as a layer letting Flex and PHP talk. Zend and Adobe
will also be, from this point on, creating links between the Zend Studio software and the Adobe Flex
Builder software to help developers to help make the integration that much simpler.
Matthew Weier O'Phinney has posted an update on two things to his blog - that he will be speaking at this year's ZendCon and that new things have been posted from his Zend Framework & Dojo webinar the other day.
First off, you may now view my Dojo Webinar online (requires login and registration at zend.com). Attendance was phenomenal, and I've had some really good feedback. [...] Second, I've completed what I'm calling version 1.0.0 of the pastebin application I demo'd in the webinar. The PHP code is fully unit tested (though I haven't yet delved into using DOH! to test the JS), and incorporates a number of best practices and tips that Pete Higgins from Dojo was kind enough to provide to me.
This application can be downloaded directly from his site, ready to drop in and test with your local Zend Framework install.
Matthew Weier O'Phinney has another post full of Dojo/Zend Framework goodness today - this time he looks at making proper layer files by combining the two.
During my Dojo and ZF webinar on Wednesday, Pete Higgins of Dojo fame noted that I could do something different and better on one of my slides. This particular item had to do with how I was consuming custom Dojo build layers within my code. I contacted him afterwards to find out what he suggested, and did a little playing of my own, and discovered some more Dojo and javascript beauty in the process.
The improvement replaced the need for a manual commenting/uncommenting of an addLayer call with a bit of namespaced layers that, based on the environment, adds a dependency for the right file. One less manual process, one less thing to go wrong on deployment.
With the recent release of the 1.6 version of the Zend Framework, Andi Gutmans has posted some thoughts and highlights of features in the new version.
The Zend Framework Community has delivered another feature-rich release of Zend Framework and I'm extremely proud and happy to see the energy and excitement around this project. The ZF team (Wil Sinclair, Matthew Weier O'Phinney, Ralph Schindler, Alexander Veremyev) along with many others in the ZF community and at Zend, have been doing a superb job and have been working very hard to put this release together.
He mentions the Dojo integration, the updates to the SOAP component, updates to make test-driven development simpler and a reminder about ZendCon08 coming soon that will feature several Zend Framework-centric talks.
The IBM developerWorks website has a new tutorial for those looking to get into the powerful combination of Ajax and PHP - an introduction to creating Ajax-based websites with PHP.
Learn the process of writing Asynchronous JavaScript + XML (Ajax) applications using native JavaScript code and PHP. This article introduces a few different frameworks and application program interfaces (APIs) that reduce the amount of code you need to write to achieve a complete Ajax-based Web application.
They (briefly) explain what Ajax is and the benefits of it before jumping right in to a sample page. They go for the "manual first" approach so developers know to make basic connections with the XMLHttpRequest object and handle the responses. They do mention some of the libraries offered that help with the connections too (like jQuery, Prototype and Dojo).
On his blog today Matthew Weier O'Phinney has pointed out a webinar that he'll be giving (for Zend) on the recent popular introduction into the Zend Framework - the Zend Framework and Dojo.
I'm particularly excited about this webinar, as I've been developing a sample pastebin application to show off a number of features; the webinar will feature some screencasts showing the new code in action, and promises to be much more dynamic than my typical "bullet point and code" presentations.
Be sure to register before hand to get your spot in what will undoubtedly be a popular event.
Matthew Weier O'Phinney has posted a tutorial to his blog that shows how to implement the dijit.Editor (a dijit helper that didn't make it into the current release of the Zend Framework).
We're getting ready to release Zend Framework 1.6.0. However, one important Dijit had to be omitted from the release as I was not able to get it working in time: dijit.Editor.
This dijit is important as it provides an out-of-the-box WYSIWYG editor that you can use with your forms. Unfortunately, actually using it with forms is pretty tricky -- Dojo actually ends up storing content outside the form, which means you need to create a handler that pulls the content into a hidden element when saving.
He includes the code for a sample view helper to implement it and how to include it into your Zend_Form via an addElement call.