should i learn zf2 to use zend expressive - php

For those that have begun playing around with zend expressive, does it require knowledge of zend framework 2? meaning do I have to learn/know zf2 in order to use Expressive? or did they make enough changes where learning zf2 would be pointless/confusing?
along those same lines, other than the zend-expressive.readthedocs.org page, can anyone recommend some good tutorials/walk-throughs to get started ?

I would say that the knowledge of Zend Framework 2 is not required to work with Zend Expressive. Certainly, the two share some components (Zend.Mvc for the routing and Zend.ServiceManager for DI, if you choose them in Expressive) and the logic of some things is similar, so a knowledge of ZF2 would not go wasted. But if you don't know it, you don't need to learn it before starting to use Expressive.
Regarding some useful resources on Expressive, here are some:
http://www.sitepoint.com/build-nasa-photo-gallery-zend-expressive/
http://www.masterzendframework.com/zend-expressive-introduction/
https://github.com/RalfEggert/zend-expressive-tutorial
https://www.briefs.fm/zend-framework-bites

You don't need any zend framework experience to start with zend expressive. But it gives you a head start when using zend components in your project.
Some more links to get you started:
Official docs: https://zendframework.github.io/zend-expressive/
Project examples: https://zendframework.github.io/zend-expressive/reference/expressive-projects/

If you already know Zend Framework, namely things like,
PhpRenderer
ServiceManager
ViewModel
it will help you, because you can choose those ZF components to go into your Expressive configuration and get a good head start, instead of taking baby steps learning what those are.
But, if you do not already know those, there is no reason to learn Zend Framework and I could argue that learning Zend Framework, in order to use Expressive, will be detrimental.
That is, because, Expressive, builds on new ideas of a microframework, and using pipelines of Middlewares, rather than a pre-determined pre-set pipeline of Zend Framework's zend-mvc module, and Middlewares and zend-mvc are quite different. If you are new to Expressive, I'd look into each concept separately and pick the components you wish to use. The concepts are
Routing
Dependency Injection Container
Templating
You can also pick your own Error handling module. Also Expressive gives you standard compliancy, such as PSR-7 and PSR-15 when it becomes available.

If you already know Zend Framework, namely things like,
PhpRenderer
ServiceManager
ViewModel
it will help you, because you can choose those ZF components to go into your Expressive configuration and get a good head start, instead of taking baby steps learning what those are.
But, if you do not already know those, there is no reason to learn Zend Framework and I could argue that learning Zend Framework, in order to use Expressive, could be detrimental.
That is, because, Expressive, builds on new ideas of a microframework, rather than a pre-determined pipeline of Zend Framework, and those are quite different. If you are new to Expressive, I'd look into each concept separately and pick the components you wish to use. The concepts are
Routing
Dependency Injection Container
Templating
You can also pick your own Error handling module. Also Expressive gives you standard compliancy, such as PSR-7 and PSR-15 when it becomes available.
It can be good to know Zend Framework (or similar framework) because working with those frameworks gives you an understanding of how those components are built, and how they connect. However, Expressive Skeleton gives you a pretty good idea and a good headstart on very good groundwork concepts and modern web development (routing, templates, error handling, DI container). Newer concepts in Expressive are Middlewares and piping them together. Those were not present in Zend Framework at first, but now they made it in there as well.

Related

Zend Framework 1.x and 2.x, How Compatible Are They?

I am interested in learning Zend Framework 2.x, and I've noted that there are many good books written about ZF 1.8, 1.9, etc... however, I haven't come across any that explicitly states it is for ZF2 (except for one, and it was written in German).
In order to learn ZF, I could sit an learn it through the documentation... however, that sounds rather unsavory, despite the fact that it contains the latest information and arguably is the "best" source. I would like to endeavor in the more abundant sources on versions 1.8 or 1.9 as I learn this framework.
How much overlap is there between 1.8/1.9 to 2.x? I know 2.x uses namespaces and many new PHP 5.3.x features, but are there really that many changes between the implementation of these versions that I would be wasting my time trying to learn anything less than 2.0?
I'm aware that even if there is a large amount of compatibility, I would still have to come back and fill in a few "knowledge gaps". I'm just looking for a quick run down of the framework overall.
Thank you for your time.
Zend Framework 2 is very different from ZF1. It's core has been rewritten and the MVC structure has changed quite a bit.
The blog post announcing ZF2 goes into some detail on what has changed and why so I would recommend reading that. If you haven't used ZF1 extensively, you won't know some of the components they are talking about but that's okay. But as it states, ZF2 will look alien to those familiar with ZF1. Part of this is the new MVC structure and there are many new core components not available before including the ModuleManager, ServiceManager, and EventManager which provide better ways of accomplishing tasks that were more abstract to accomplish in ZF1.
Unless you plan on working with ZF1 projects, there isn't much sense in learning it at this point; I'd jump right into learning ZF2 at this point. If you were to learn ZF2 now and come across a ZF1 application down the road, there will be things you run into you aren't familiar with but largely you should be able to understand what's going on and get in and edit the application and learn what you need to know as you go.
Since the libraries provided by ZF1 and ZF2 are able to be used standalone, it would be possible to use some ZF2 classes in ZF1 as long as those classes aren't too tightly coupled to other classes in ZF2. For example, you can use Zend\Crypt from ZF2 standalone quite easily, but trying to use Zend\Form might be a different story since its tied to views, validators, filters and other classes.
As for learning ZF2, like you said there aren't many books around yet since its so new, but there are a lot of resources available for learning it aside from the reference guide.
I'd recommend looking at Getting Started with ZF2, the ZF2 Skeleton App, as well as the Zend Webinars where you can already find some great ZF2 tutorials including a presentation called Getting Started with ZF2 presented by The Zend Framework project lead Matthew Weier O'Phinney. There's also an upcoming webinar about MVC that's worth registering for (its free).
Hope that answers your question!

A CMS on 2 DIFFERENT frameworks?

I'm not sure if this is possible, but let's say you want to build a CMS, but you're torn between 2 frameworks because each has some features that you like. Is it possible to create the CMS with both framewoks? Does this approach have merits or pitfalls?
Speaking strictly about the Zend Framework (ZF) I would say yes. ZF components are written to be as independent from other components as possible. I would say that it would not be very difficult (It may actually be quite common) to integrate libraries of ZF into other frameworks like Cake, Symfony, or Codeigniter.
Is it possible to create the CMS with both framewoks?
While it's possible to use components from the Zend Framework inside other Frameworks / CMSs - this may be the case with other component libraries as well, but Zend's the most modular one that I know - It's usually not a good idea to mix two full-blown Frameworks.
Many central functions like MVC structures, URL routing, the database layer, Unit testing, error management and so on are by nature unable to be served by two frameworks at once without massive friction. Also, you're likely to get problems when one of the frameworks needs to be updated.
I would recommend to pick the framework that covers most of what you need, and try and add the missing features using plug-ins or own modifications.
Your question is too abstract.
For instance Zend Framework is more to be a library of specific functionalities ready-to-be-include into Your codebase then some closed development environment like for instance Symfony framework.
Thanks to it can be ZF simply included into your codebase (and Symfony too).
Symfony Framework compared to it is closed solution depending on front server environment so you cannot use it like some other framewor's slave.
It would really depend on which things you liked about both...
Zend Frameowrk is more like a library, so you can pick and choose components from it. Symfony also has some re-usable components you can use.
Really, you can do anything... it just depends how much work you want to do, and how willing you are to modify the framework code. Note: most other PHP frameworks are not nearly as flexible as Zend Framework (next up probably being Symfony).
This sounds very messy, so I'd advise against it, unless you use it in the fashion I've described above. It's easy to pull ZF or Symfony components into other frameworks, but not the other way around.
Hope this helps.
The composability of most frameworks is such that that is most likely to give you all the disadvantages of both, while simultaneously eliminating most of the individual advantages of both.
It seems to me like one framework will for serve as the core - bootstrapping, MVC stack, routing - while the other will be used to pull in specific functionality - like classes for forms or filtering or interacting with web services, etc.
As much as I prefer Zend Framework for the core - and most everything else - its use-at-will architecture argues for making the other framework the core and pulling in ZF components where you need them.
As #Adrian notes, it's easy to pull in ZF components into a project built primarily on another framework, since ZF is designed with that flexibility in mind. Other frameworks are less accommodating in this regard.
You can do it. Most modern frameworks (Zend, symfony, flow) is capable to use parts of other frameworks. Symfony 2 uses Zend Logger, flow3 uses sfYaml... It is possible tu interchange some components.
But, imho, you should stick to one framework as a core, and use second only to relatively isolated subsystems. Adapter and Facade design patterns can help you to mix them together - some components / clases demands some wrapping before use in non-native environment.
For further reading: http://www.symfony-project.org/book/1_2/17-Extending-Symfony#chapter_17_integrating_with_other_framework_s_components
Of course it is possible and I don't see something wrong with it. For example I used CakePHP and Zend on a relatively large Project which was kind of a cms. CakePHP for the core (Routing, MVC) and Zend for some "Modules". Mainly for PDF, E-Mail (smtp), FTP and a few others that CakePHP was not that good at. With Cake it was fairly easy to use ZF components and didn't feel hacky at all.
In fact, ZF was written to be as independent as possible, so that you can use any component at any time anywhere. Yet, it would not work the other way round (Using ZF as core, and Cake components). Surely it is possible, but a real pain with no benefits. So ZF could be used propably inside of pretty much any other framework and nothing would be wrong with it, imho.

component-based php framework?

could someone give an example of the meaning of this word?
i read about that prado is a component-based framework and i wonder if cakephp and codeigniter are too?
A component based framework basically means that you can pick and choose the elemnts of the system you want without having to refactor those individual elements themselves. Zend Framework is a good example.
Usually the opposite is highly couple framework like CakePHP or RoR. In these cases it is much harder to divorce and individual component like the Router or Controller and use it outside that framework's stack.
In general you want to minimize tight coupling so you get the most out of reuse and have the most flexibility in terms of replacing components or modifying them. The thing i find i often dont like about component frameworks is that while the individual components are often well designed and have a default way of working with each other often a ton of development time isnt poored into automation of using the tools together. Take Zend Framework for example. GREAT COMPONENTS, however with 1.10 we finally see a decent commandline tool to automate setup and initialization of modules/controllers/views etc.. There wanst a defined bootstrapping process/convention until 1.8 i think it was... For me this is one of the most important parts. Something highly boasted by RoR, Django, Cake, Symfony, CodeIgniter and others.

PHP MVC framework for ASP.NET MVC/NHibernate developer

For class, I would like a to use PHP MVC framework very similar to ASP.NET MVC with NHibernate. I am very comfortable with ASP.NET MVC. I need to use PHP and MySQL. I would not like to be concerned with the SQL to save me time. I would like to just design my PHP model classes and controllers without all of that data-access logic behind it that I would have to write.
Any suggestions? Thanks.
Also, I'm very limited on what I can install on the server. For instance, I can't upgrade PHP or run other installers. I want something I can drop in.
I prefer Zend Framework MVC components combined with Doctrine if really want great power. but for something simple try CaKePHP as it has its own simple ORM implementation, and the framework is built to be the php version of Ruby on Rails.
My personnal preference for "MVC Framework" would probably be Zend Framework -- though it's not the only possible choice (I'm thinking about symfony too, for instance).
About the "not writing SQL" part, I would use Doctrine, which is a great ORM Framework.
It's actually the default ORM Framework of symfony, and can be used with Zend Framework quite easily.
I suggest Symfony. It uses Doctrine (which is inspired partly by Hibernate) too, but it is integrated deeper with Symfony than Zend Framework. Symfony provides a number of helper classes which really help automate things with Doctrine (my favorite is sfDoctrinePager). Zend Framework is a good choice, but I recommend looking at Symfony first. I would avoid the other PHP MVC frameworks as they tend to be less flexible, and if you're coming from another language you may have your own preferences on how to attack a certain problem - Symfony and ZF will both give you leeway in this sense.

CodeIgniter, ZF, etc

I use ZF a lot and I like it very much. I've learned how to solve a big part of perfomance problems with ZF, so it's became not "enormous" and "monstrous" for me.
But I'd like to know if there are any as powerful frameworks as Zend for PHP. Maybe CodeIgniter is? What is it? What are its cool features? Anything else?
And, are there any powerful frameworks which realises not MVC? Powerful means not just implementing of design pattern but a library of useful classes, functions, etc
There is a difference between frameworks, some are regualr frameworks (used to be called 'class libraries'), and some are 'full stack frameworks' (used to be called 'frameworks'). The web is and will always be about buzz-words...
Zend is a regular framework, which means you can use it's components separatly, and you aren't forced to use them. In a full stack framework, like CakePHP (I don't reallt know code igniter), you are locked inside. You can only use it's classes and they are hard to extend.
If you are looking for a competitor for ZF, be sure not to compare it with a 'full stack' framework, because it's a different thing, and it solves different problems...
Other then that, I don't know any frameworks that do not implement or give you the possibility to implement MVC, just because it's very applicable to web applications.
I'm a big ZF fan, but you can take a look to Symfony which is pretty powerfull but maybe a little to heavy sometimes.
I'd personally recommend Kohana. They just released 3.0 less than a week ago (it's in the forums, not on the dl page). It used to be a branch of CodeIgniter for PHP5, but it just underwent a big rewrite so now it's much cleaner and faster.
Basically, it does just enough to help you, but stays the hell out of your way. It's very lightweight and fast. It beats the pants off of pretty much any other framework I've used - Zend, Symfony, CakePHP, and CodeIgniter.
The thing about Zend is that you can actually decouple its components. You can use them without using the rest of the framework (just register the autoloader). Really, Zend to me is more like a heavy framework with a bunch of PEAR libraries in it. The framework is too heavy for normal use, but the components are nice.
I personally like CodeIgniter, it is good to start from 0 due to its great documentation and it can be easily expanded with the lot of plugins. It is considered pretty fast framwework (faster than ZF, Cake php and Symphony) however its speed is lowered by PHP4 support and any framework will lose its speed as you add new libraries and plugins there.
ZendFramework is the most powerfull php framework I have found. CodeIgniter is a lightweight MVC framework so its not powerful.
ZendFramework also has loose coupling so you can use some Classes without other classes like the front controller.
CodeIgniter MVC is not as powerful and the ZendFramework MVC but i haven't tried any other framework
I've choosen CodeIgniter because it is lightwight and because i'm not using a ORM and Smarty, this means i only need the router and controller/model class.
But it is missing a few features like user/login handling being the most serious.
I also use some zend classes like amazon access.

Categories