Yii2 And Zendframework2


I found this article on using Zend with YII 1.1:


Is there somewhere an updated version for YII2 of this article?



What exactly do you want from the article? Articl itself, using Zend or just XML writer?

No, I would like to know the "best way" to use ZendFramework2 with YII2…



I wrote the article. I haven’t done it in Yii 2. But I guess it would be fairly similar, download Zend 2 into your vendor directory or use composer. The incorporate which ever aspect of Zend you need into your Yii project. I’m sure someone will be able to give you a more specific idea.

I guess the answer is ‘there’s none’, unless you know why you exactly need ZF2.

Since ZF is decoupled, it can be considered as a bunch of components (it is one, actually), and you treat it like one.

As for your example, there are not too much to discuss. The whole thing was simplified since Yii 1, just put zend components into composer.json (I would suggest to require the whole ‘zendframework/zendframework’ for a start if you’re not too eager to resolve some dependencies by hand), ‘use’ the required zend namespaces instead of those silly imports and go on.