Tag: php

Using dijit.Editor with 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.

I have created an implementation, however, that you can start using now, and I'm posting it below. It includes both a view helper for displaying it, as well as a form element for use with Zend_Form.

Continue reading...

Speaking at ZendCon 2008

I'll be speaking at ZendCon again this year, and have a four-course meal of sessions to deliver:

  • Best Practices of PHP Development: Mike Naberezny and I are teaming up for the fourth year running to deliver a tutorial session. While the session topic stays the same, he and I have each been developing a number of new practices over the past year that we look forward to presenting, including new work with PHPUnit for functional testing of your applications.

  • Getting Started with Zend Framework: This will build off our Quick Start, providing background on ZF as well as the basic tools and information needed to get your first ZF application up and running. I also hope to demonstrate how the current preview of Zend_Tool can simplify this dramatically.

  • Zend_Layout and Zend_Form: This session will show off features of Zend_Layout and Zend_Form. (Note: the subject matter may change.)

  • UnCon: Rich UIs and Easy XHR with Dojo and Zend Framework: For those unable to attend my webinar next week, or who simply want to see this in person, I'll be presenting my Dojo and Zend Framework talk during an UnCon session. I have developed a simple app to showcase various features of the Dojo/ZF integration, and to show how easy it is to quickly develop and then scale applications that have great, dynamic interfaces.

Looking forward to seeing you in California in September!

Continue reading...

Zend Framework 1.6.0 Preview, or, PHP 4 is Dead

PHP 4 officially died Friday. I started programming PHP with release candidates of 4.0.0 — which simultaneously introduced me to the GNU C compiler and toolset. My first official job using PHP was at a shop that was using PHP 3, and considering the costs of upgrading to PHP 4 — which clearly offerred many benefits over its predecessor. I switched to PHP 5 as soon as the first official release was made four years ago — the pains of reference handling with objects, the introduction of a unified constructor, first-class support for overloading, and SimpleXML won me over immediately, and I've never looked back. Goodbye, PHP 4; long live PHP!

I'm celebrating with the second release candidate of Zend Framework 1.6.0, which should drop today. There are a ton of new features available that I'm really excited about. I'm not going to go into implementation details here, but instead catalogue some of the larger and more interesting changes that are part of the release.

Continue reading...

Testing Zend Framework MVC Applications

Since I originally started hacking on the Zend Framework MVC in the fall of 2006, I've been touting the fact that you can test ZF MVC projects by utilizing the Request and Response objects; indeed, this is what I actually did to test the Front Controller and Dispatcher. However, until recently, there was never an easy way to do so in your userland projects; the default request and response objects make it difficult to easily and quickly setup tests, and the methods introduced into the front controller to make it testable are largely undocumented.

So, one of my ongoing projects the past few months has been to create an infrastructure for functional testing of ZF projects using PHPUnit. This past weekend, I made the final commits that make this functionality feature complete.

The new functionality provides several facets:

  • Stub test case classes for the HTTP versions of our Request and Response objects, containing methods for setting up the request environment (including setting GET, POST, and COOKIE parameters, HTTP request headers, etc).
  • Zend_Dom_Query, a class for using CSS selectors (and XPath) to query (X)HTML and XML documents.
  • PHPUnit constraints that consume Zend_Dom_Query and the Response object to make their comparisons.
  • A specialized PHPUnit test case that contains functionality for bootstrapping an MVC application, dispatching requests, and a variety of assertions that utilize the above constraints and objects.

Continue reading...

Migrating OOP Libraries and Frameworks to PHP 5.3

With PHP 5.3 coming up on the horizon, I'm of course looking forward to using namespaces. Let's be honest, who wants to write the following line?

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');

when the more succinct:

$viewRenderer = HelperBroker::getStaticHelper('viewRenderer');

could be used? (Assuming you've executed 'use Zend::Controller::Action;' somewhere earlier…)

However, while namespaces will hopefully lead to more readable code, particularly code in libraries and frameworks, PHP developers will finally need to start thinking about sane standards for abstract classes and interfaces.

Continue reading...

phpwomen at DPC08

So, one thing I forgot to mention in my DPC08 wrapup was my involvement with the phpwomen booth. Lig emailed me some months in advance asking if I'd be an official "booth babe" while at the conference — basically wearing a T-shirt to show my support of the movement, and answering any questions that others might have regarding it. While I haven't been particularly active with phpwomen, I of course agreed.

Continue reading...

DPC08 Wrapup

Last Friday and Saturday I spent at the Dutch PHP Conference, hosted by Ibuildings. Unfortunately, I had very little time to blog while there. I'd prepared my outlines and basic slides before heading to the conference, but had a large number of screenshots and images to prepare that kept me up until the wee hours of the morning each day. In addition, the conference was extremely well organized — which meant that any time not spent speaking was spent interacting with attendees or other speakers — never a bad thing!

Continue reading...

Zend Framework/Dojo Integration QA Slides

We had our Zend Framework/Dojo integration QA today. Aside from some connectivity issues at the beginning of the presentation, things went smoothly, and there were some good questions.

A number of people reported missing the slides or that the slides were not advancing. I'm posting them here; they will also be available on the Zend.com webinars page later this week.

ZendFramework_Dojo.ppt

Update: For those who want to view online, you can now do so at SlideShare.

Continue reading...

ZF Subversion Reorganization

If you've found that your SVN checkouts or svn:externals of Zend Framework are not working currently, then you missed the announcements on fw-general and #zftalk; I've just completed a Subversion Reorganization that is part of our new proposal process and 'Extras' offering. Please follow the link for details on how to update your installs.

Continue reading...

Zend Framework Dojo Integration

I'm pleased to announce that Zend Framework will be partnering with Dojo Toolkit to deliver out-of-the-box Ajax and rich user interfaces for sites developed in Zend Framework.

First off, for those ZF users who are using other Javascript toolkits: Zend Framework will continue to be basically JS toolkit agnostic. You will still be able to use whatever toolkit you want with ZF applications. ZF will simply be shipping Dojo so that users have a toolkit by default. Several points of integration have been defined, and my hope is that these can be used as a blueprint for community contributions relating to other javascript frameworks. In the meantime, developers choosing to use Dojo will have a rich set of components and integration points to work with.

The integration points we have defined for our initial release are as follows:

Continue reading...