During a code review last week, one of my clients mentioned that they were looking into alternatives to Zend_Form for their ZF1 application. They were looking for something that was easier to use than ZF1′s Zend_Form for their developers, and could easily be used with Twitter Bootstrap form markup without having to deal with decorators. Without giving it much thought, I suggested that it might be possible to take advantage of the new Zend\Form from ZF2, which would easily meet their needs, and there’s a ton of Twitter Bootstrap modules for ZF2 that easily make your forms Bootstrap-friendly.
This got me thinking… How difficult would it be to create a sort of compatibility layer enabling ZF1 applications to take advantage of ZF2 features and modules without refactoring the entire application for ZF2? Well, as it turns out, not very difficult. Allow me to introduce ZF 2-for-1.
Simply install ZF 2-for-1, and you can instantly use many of the great new ZF2 features right inside of your existing ZF1 applications. It’s even capable of loading ZF2 modules. Of course, not all ZF2 modules will “just work” with ZF1 using ZF 2-for-1, but some simple modules should work just fine. As ZF 2-for-1 improves, more and more modules will likely become compatible.