简体   繁体   中英

What is Zend Expressive and Zend MVC?

I am starting a new project in PHP and wanted to choose the latest ZendFramework. I see that Zend Framework 3 has been released so I wanted to start with Zend Framework 3 itself. But when I go to the INSTALL page of Zend, they have given options as Zend MVC and Zend expressive.

I read about them and have an understanding that Expressive is a microframework while MVC is a full-stack framework. Apart from this I am not very clear about them.

I see that Zend MVC was also there for ZF2 and the documentation says MVC as a layer. I could not find Expressive for zf2 though.

Question:

  1. Are both Zend MVC and Zend Expressive packages? and are part of zf3?
  2. When I see the installed packages in Zend MVC and Zend Expressive, I don't see a package for Zend framework, but I see separate packages for Zend Components such as zend-http , zend-json , etc. So are these (expressive and MVC) just built over different Zend components?
  3. How do I know that I am using ZF3?

Are both Zend MVC and Zend Expressive packages? and are part of zf3?

This depends a bit on your definition of "packages". Zend Expressive is not part of ZF3, it is a microframework alternative to ZF3. Zend MVC and Zend Expressive are both packages, and they also depend on other packages. ZF3 is what is known as a "meta package", which means it doesn't have any code of its own, it is soley a collection of other packages. The ZF3 meta package includes the Zend MVC package.

are these (expressive and MVC) just built over different Zend components?

Yes, and there is quite a bit of overlap.

How do I know that I am using ZF3?

This is more a question of semantics. If you have the Zend Framework meta package installed, that's ZF3. If you were just using the MVC package, you could argue that's still ZF3. If you are using Expressive, that's something else.

The line between ZF3 and Expressive (and when you would use one over the other) is somewhat fuzzy. This discussion may help you.

In an earlier edit you asked which you should use to create a REST API. You could do that with either.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM