Does anyone know how to deal with ACL and Doctrine 2 inside a Zend Framework 1.11.10 Project ?
Thanks.
Regards.
The ACLs are handled with Zend_ACL(), and as you do not have to use Zend_Db or Zend_Table or whatever classes Zend Framework provides, Doctrine-Integration should be as intended by the doctrine-manual. Here's an article on how to do it with Doctrine - it should be easily adaptable to Doctrine2.
Related
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:
Are both Zend MVC and Zend Expressive packages? and are part of zf3?
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?
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.
I've got an existing project using zend 1.10 framework. I'm not fond of zend but I can't sell the idea of converting over to symfony, I'd like to just incorporate symfony 2 into the code base and at least use it for new code (doctrine, forms and twig templates at least, even if I'm stuck with zends' MVC structure).
Not sure how to go about setting this up. I see lots of mention of using Zend classes in Symfony but not the other way around.
You can use Twig and Doctrine with ZF, so that's no problem. However the forms component is not on the list of stand alone components for Symfony 2 so implementing Symfony 2 forms in ZF 1.10 might be tricky.
Good Luck.
I found a few Zend sample applications but all of them use Zend_DbTable. Does anyone know of a full Zend example application built with Propel to learn from?
I don't know of any complete applications, though there are quite a few articles on how to set it up. Just make sure you initialize Propel in your bootstrap, and then use your Propel classes as per usual. There's nothing special about it...
How to Zend Framework with Propel ORM could be handy.
I have never used any ORM, but the Zend_Db_Table (if you can call it one). I'd like give it a try with some famous ROM and I've only heard of these 2 (Propel and Doctrine).
I tried sometimes in the past but I found it too hard to integrate or maybe I didn't understand how it works.
Now that I'm trying again, I'd like to know which one has easier integration with Zend Framework and which one is easier to work and why
Doctrine and Propel are definitely the two best know PHP ORM's among some others.
Doctrine has definitely seen some more love from ZF and there is rumors that Doctrine 2 will play a major role in ZF2, though afaik nothing as been confirmed as of this writing.
Here is some links for you to follow:
Integrating Propel with the Zend Framework (2006)
Brandon Savage: The Adventures Of Merging Propel With Zend Framework
and
Ruben Vermeersch: Integrating Zend Framework and Doctrine 1.x
Matthew Weier O'Phinney: Autoloading Doctrine and Doctrine entities from Zend Framework
Doctrine 2 and Zend Framework first date
Also see these two questions that have additional information and links:
Zend Framework 1.9 and Doctrine Integration
Integrate Doctrine with Zend Framework 1.8 app
Should not be hard to find many more for Doctrine.
EDIT very nice one from Phil's comment:
Zend Framework / Doctrine integration suite
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.