As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have known PHP basics, functional programming for a long time before. But this year, in my 2nd semester I have learned Object-Oriented Programming with Java. So I want to apply my knowledge of OOP to PHP. But I find it very difficult to think of any decent utilization. It's not like in Java everything is an object. I see it easier to connect to database an old way, to write some simple functions for logging or registration, etc.
All those examples http://php.net/manual/en/language.oop5.php just gives me knowledge about syntax, not methodology of using it.
So I began to think. Maybe it's because I wanted to apply OOP without any Framework, and it's no use without it? If so - any Framework recommendations that are easy to learn?
OOP is a methodology used to organise your code into meaningful, reusable entities and it doesn't alone answer to the question of "how to best organize your code to create web applications".
Most of the web frameworks use Model-View-Controller architecture (MVC) along with OOP. In order to understand how web frameworks work, I suggest you to familiarize yourself with MVC as well (for a starting point, see "Coding Horror: Understanding Model-View-Controller")
Also, regardless of any frameworks, it is crucial to understand some basic concepts when creating web applications. At the minimum, familiarize yourself with how sessions work (http://www.php.net/manual/en/book.session.php), as well as how you can access databases (PDO for generic database connectivity, MySQL for MySQL-specific binding, etc.).
As for what web framework to choose, the options are plenty. Therefore consider the following pointers as informative:
Yii Framework has a pretty clean OOP-based design (http://www.yiiframework.com/)
Another popular object-oriented PHP framework is CakePHP (http://cakephp.org/)
For a more light-weight framework with less overhead, consider CodeIgniter (http://codeigniter.com/)
The de facto web framework for PHP is Zend (http://framework.zend.com/). Its huge, comprehensive, well-supported, but not always the perfect companion when travelling light.
Also note that if you organize your code according to MVC, you may find yourself most comfortable when not using any frameworks at all
Also note that unlike in Java, in PHP object-oriented features have been slowly added during its versions 4 and 5. Therefore, many web frameworks designed for earlier versions of PHP may not provide you as cleanly object-oriented design as you might want. Therefore when choosing a framework, consider whether you opt-in for backward-compatibility (PHP4 support) or are you seeking for a clean, object-oriented design in the framework (mostly PHP5 required).
OOP has its usage outside of a framework, you cannot compare apples with oranges.
The most respectable frameworks out there are written in OOP. So try to use one such framework in order to see use cases of OOP, then learn from that framework (step through with a debugger and learn how the framework works from the inside).
I would recommend you two things, if you really want to become a pro:
Zend Framework - not easy to learn, but it will show you lost of things from the next point:
a book about design patterns - VERY VERY IMPORTANT
Regarding the databases: modern PHP code should use PDO.
The framework will only show you usages of design patterns and how to organize your code, so you'll develop a "common sense" for it.
After you've passed that point, you will be able to invent your own OOP-world, without a framework (if this really needs be, although a framework gives you the time to actually be innovative).
You don't need to learn any PHP framework to start applying OOP principles. You can check out this fine answer to see some application of OOP without any framework.
Learning a framework is definitely a good choice, because then you can use lots of ready-made component. There are a lots of PHP frameworks nowadays. You can check out CakePHP, Zend (component-based), YII, Symphony (Yahoo uses it), CodeIgniter etc.
Hope this helps.
First of all, you don't need a framework to utilize OO style of programming in PHP; in matter of fact PHP has many core classes that use object oriented approach. For example take a look at PDO or the SPL.
Anyways concerning frameworks, there are various OOP-based frameworks out there, most which follow the MVC pattern. Some popular frameworks you might want to look into:
Zend Framework
CodeIgniter
Symfony
CakePHP
Zend Framework is very extensive, but the learning curve can be quite steep, but it's definitely worth the effort. If you want a good introductory MVC framework, I can recommend CodeIgniter; it's very lightweight and easy-to-use. Unfortunately I have no first-hand experience of Symfony or CakePHP (or other MVC frameworks).
You should use framework. Your code will be more easily edited by other developers if you do so.
Code Igniter is quite easy and basic, but you can check out Zend, Yii, Symphony and so on.
I recommend you Codeigniter framework to start with
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I have heard a lot about PHP frameworks like ZEND, CodeIgniter,CakePhp etc and i am also well aware of some advantages of using it i.e. increased productivity,reduced errors etc but doesn't php framework make coding a complex process ? Doesn't coding without framework provides more flexibility ? Some people say you don't need any additional framework, as PHP is itself a framework.
So why there is so much usage of PHP framework ? Are frameworks really necessary in PHP?
This is a broad question and I think an important one. I am in the camp of NOT using frameworks unless absolutely necessary. The question is, when is it necessary?
First off, the thing that I think gave me this strange, allergic reaction to frameworks is that inexperienced coders want to use them for EVERYTHING, even tiny sites.... and it's bizarre. Maybe its through some need to make their resumes bigger by saying they've used codeigniter- but in my experience that doesn't make a damn bit of a difference. Hiring managers want SKILLSETS, not somebody that can read API documentation- which anyone can do. If you have working knowledge about program architecture and OOP principles, you're hired. If you don't, but you're a codeigniter ninja, .... eeehhhh.... ok?
Frameworks have their uses but I think when your mom wants to make a website for her bake sale then you can just slap a page together using a much lighter weight system. I don't sit in the camp of belief that you should include code "in case you need it". Over time, I have developed my own framework that is absolutely tiny, which is why every single web site or application I have ever built has ranked in the top 2% (though usually top 1%) of page load times in the world by google.
This is not to say they are bad- just don't go running off to use a framework because you want to put it on your resume- you're actually shooting yourself in the foot in the long run. Why? Because you won't spend time using the language itself, you'll spend time using the language of the framework. Take jQuery for instance- I avoided it for YEARS because it wasn't JAVASCRIPT. People scoffed at it- but now, when I go to a technical interview and I get asked (inevitably): "What is your experience level with jQuery", and I say "not much", and they for a second look surprised, but then I follow it up with "but I just wrote dependency injection via inversion of control in native JS yesterday"- I get hired ON THE SPOT.
Frameworks are great. Just ask yourself if you really need them. Particularly the question is: are the benefits of coding it yourself outweighed by the time benefits (don't forget about the learning curve of the platform) of the framework or not? On the one hand (non-framework approach), you learn a lot, and perhaps you take more time because you're working out your own kinks- but you learned a ton about the language itself (PHP in this case). On the other hand, you learned a new framework and maybe got a site up quicker that most likely is slower.
Wordpress is a great example of an overused framework in my opinion. Back in my freelancing days I used to take on gigs that needed me to "revamp a wordpress site"- only to find a site that could barely load because somebody plugged in every plugin they could find and made what was a stupid simple site into a tank with ungreased treads. It's OVERKILL in that case.
With my experience in CTO and Tech Lead positions, when somebody puts Wordpress and jQuery as primary points on their resume, to me that says "I don't know a thing about OOP and how to use these languages if required" which, in the real world (and I work on huge projects like windows 8 and other projects of that magnitude) - is OFTEN the case. Microsoft expressly forbids the usage of jQuery in their metro app system for MS released products because they want to show off their system dependency free.
Other companies, however, DO use frameworks. I just got off a project using Foundation and it was AWESOME- but that's because the architect of the project fully researched the framework and we used it RIGHT. The result was a fully responsive pristine code base that went from full monitor glory down to triscuit-sized smartphone screen awesomeness.
IN SHORT:
Frameworks, when used right, can be awesome- particularly for large projects (and I'm talking enterprise large). For smaller projects they aren't necessarily bad- but when they are used without thinking about their implementations, its like using a hatchet for a scalpel.
Just my 2 cents.
Doesn't php framework make coding a complex process?
It depends what you want to do. If all you're doing is creating a basic contact form for a site that is all static HTML, then yes using a framework would make it a more complex process. On the other hand if you're building a large scale app then using a framework would not necessarily make it more complex.
Doesn't coding without framework provides more flexibility ?
This depends on the framework itself, they aren't all the same. Some frameworks such as Slim or Codeigniter are very trimmed down and don't get in the way too much and so don't really impact on flexibility, some are more complex such as Symfony2/Zend.
Some people say you don't need any additional framework, as PHP is itself a framework.
They are right, you technically don't need a framework, you can do anything with plain PHP that you can do with a framework. Frameworks have really evolved from developers personal archives of functions and helper code. PHP can be relatively low level in that it doesn't have a ready made function to do everything you need. Before frameworks, developers tended to have their own set of helper code that would be reused on many projects. Frameworks are still essentially that, except they are collaborative projects that hundreds or thousands of developers contribute to.
One other benefit of frameworks is if you have several developers, and one has developed an application and you want another developer to contribute to it or take over it, then if the developer is familiar with the framework that was used he can get up to speed on the app much quicker than if it was written in plain PHP. Without the framework, the new developer would have to decipher the previous developers system before they even start to look at adding any new functionality.
Are they necessary in PHP?
No they are not, sure it is possible to code anything without frameworks. But it's more work, this is like: Why am I using C when I can do all the same by writing assembler?
So why there is so much usage of PHP framework?
The benefits of using frameworks is, that you can use many predefined things. For example, in most PHP frameworks you can use MVC Pattern. Sure you could also build your own MVC structure with flat PHP, but that is like re-inventing the wheel everytime again. Only thing is, if you have very specific requirements, you may can/should not use a framework, but in most cases the requirements are not that specific.
The point with MVC is only one of a lot benefits. Depending on the framework you want to use, there are specific benefits.
So, it is just like you said. By using a framework you can save time, because you don't have to re-invent everything that already exists.
You can see a framwork as a tool, that helps you to develop better and faster.
Edit: Like Ayesh K mentioned in his comment, it is also a benefits, that a framework is developed by many experts, so it normally is better code, following the principle: 'Four eyes see more than two'.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know this has been done many times before (some posts are really old so would be nice to get feedback based on current state of play), but I would like people's advice on which framework to use for a new application that we are about to start developing.Though we have set-up everything according to ZEND but now client's investor need to know why we choose Zend.
It was selected on the bases, out of 5 developers 2 are familiar with Zend. Now client want a detailed explanation why we didn't choose Symfony over Zend. Our reason is not enough to support our selection ;) so help me to choose which framework has what advantages over other so that we can present him solid reasons(for zend), and if symfony has more +ves then why we choose it(symfony) NOW. We can change our framework now.
I guess the correct answer is 'depends on what you're application and you're own requirements/preferences' so here is a brief description of the application and some of our own requirements:
The Application:
A financial transaction system extracting live transactions data done over thousands/millions of POS world-wide.
Few important things for project:
Database is already provided to us & it is an ORACLE database.
Oracle database has more than 86 tables. Some of the tables have more than 60000 rows of data at present & some of them have 79 columns too.
Our Requirements:
good support for jQuery
allow easy output of different types of output (HTML, XML, JSON)
easy UI development using in-bulit functions/methods.
ACL
fairly fast development (as always, schedule is tight)
nice clean business logic layer with freedom to architect the solution as we like.
a framework that helps you to get stuff done quickly but doesn't restrict you too much.
a good platform for doing other projects.
Any feedback from people who have used these frameworks (specially those who have used both) would be much appreciated.
Zend is not compulsion, but if changed to symfony, we need support for that. So support your answers with reasons, links.
Thank you.
Why Zend
First of all, I had my good experience over working with Zend Framework. It is most stable framework over all the php RAD Frameworks. Zend provides you jQuery builtin Class as Helper that will make it easy for you to make jQuery usage most easy. Even though, it provides the best usage with Dojo too. ZendX_jQuery class makes it easy for you to make use jQuery whenever you want. And, as you know jQuery allows ajax calls by $.ajax*() so it would be perfect choice for going through client side scripting.
However, I'll focus over the zend too because you can go through writing your API for most of the common transactions all over the site. As, ZEND provides Using AjaxContext with Zend_Rest_Controller and Zend_Rest_Route classes for this purpose that holds the Ajax context.
Zend has the best cache system. Even though, it provides the perfect search indexing using lucene. It is easy and stable to make your own re-usable component in your class library. CLI makes your structure delightful so no need to make everything manually.
No problem of managing templates. Action loads its view by prefix. View doesn't bounds you to have any templating engine. However, you can go through that too.
Layouts capability makes it extremely perfect to make generic and dynamic layouts that would be based over different of the controllers based upon ACL. And by ACL, i also got that Zend_Acl provides the complete solution over implementing out the ACL services. ACL is ofcourse the mandatory thing in your application.
Zend also provides you ability of having the modular structure of your site. Just plug and play your code snippets.
Why Symfony
I never gone too much deep over the symfony. However, I experienced it before for one of my project. Overall, as comparing, zend has decent folder structure then symfony. Symfony provides you ability to your code snippets but those snippets are known as bundle here. It has some templating styles that you need to implement in your views. It didn't found any built-in core library for implementing jQuery dynamically. May be, I would be wrong here but I don't know about it yet!.
I also got the same situation when I need to compare Zend & Symfony. But, after looking over all the aspects, I decided to go through the Zend.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm an intermediate PHP developer with no experience building a large scale web application in this language (though I have in others, mainly Rails)...say I wanted to build a social networking site using PHP and MYSQL (preferably) with all the web 2.0 trimmings.
Where should I start? What sort of frameworks should I be looking at? Any up to date modern books that would outline something like this? Really anything for building a modern web app in PHP.
Ryan, there is a php framework called Elgg which is a php framework directed at social networking based applications.
A whole list of them:
Top 40 Free Open Source Social Networking Software
I suggest you have a look at the Yii Framework. It is very well-designed and was written with performance in mind. They've heavily focused on optimising their code for use in combination with an opcode cache like APC - no other framework has shown the same level of performance improvement when used with APC. Outside of performance, the framework also offers lots of built-in support for security (secure sessions with HMAC, SQL injection prevention, XSS prevention, etc.), forms, user input validation, caching, authentication/access control, and JQuery integration.
If you're an intermediate PHP programmer who is not experienced/confident enough to build your own framework, then Yii is a really good place to start as the code is very elegant and imho the programmer made some great design choices while writing the framework - simply reading through the Yii code makes for a great way to learn about how to design/write good PHP code.
Just my two cents...
Wikipedia has a comparison of various social network frameworks / software:
http://en.wikipedia.org/wiki/Comparison_of_social_networking_software
Several of them use PHP / MySQL.
I also saw this book on creating a social network in PHP:
Create a powerful and dynamic Social Networking website in PHP
What sort of frameworks should I be looking at?
Try a modern framework like Kohana or maybe something more engineered-OO like Zend Framework.
You also might want to consider a simple procedural framework instead of an OO framework. PHP does very, very well working at low levels.
Avoid Cake. It tries to be Rails-like, but not only do Rails idioms translate very poorly into PHP, Cake is stuck in the design era of PHP4.
People Pods may be what you're looking for. It's a PHP framework built with social networking in mind.
I'm actually doing this right now currently with Zend Framework, and it is working out fantastically well.. Zend is seriously powerful and scalable.
I've always hated doing all the initial work of creating login accounts and hashing passwords and putting stuff in place to manage SESSIONS, so moving forward with new work I plan on checking out an early revision of this project and simply forking it into whatever other site that requires logins.
I think the place to start is to really understand the fundamentals of HTTP and the tools PHP gives you for dealing with its stateless nature.
Beyond that, I would look into templating. Perhaps Smarty?
Finally, all of the normal MVC design patterns stuff apply equally to PHP, and there are lots of implementations if you'd like to use something off the shelf. You might want to check out Cake, if you need a framework.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am mainly looking for good development practices specially when working in conjunction with mysql. I searched through the questions but could not find any related questions. I would appreciate if some one share their practices and wisdom gained through experience.
Apart from some coding standards, I am also looking for design standards and common architectural practices.
Background: I started my career with Java, and over the years I moved to C#/.NET space. I have been practicing architect for over 3 years now. Just added this to give some idea to people.
I would suggest that you familiarize yourself with the history of PHP, I know that doing so has given me a much greater appreciation of what PHP is today and where it has come from.
In short, PHP was written by Rasmus Lerdorf to provide simple wrapper functions for the C code that was actually doing the heavy-lifting so that he could have a simpler language / syntax for writing templates that needed to behave dynamically. The growth of PHP and the community which surrounds it is best described as organic. And much like other things that grow organically, its more than a little messy, asymmetrical, and downright non-congruent.
Once you understand PHP and its community, you need to embrace PHP for everything that it is and everything that it is not. This idea was best presented by Terry Chay in his article PHP without PHP. He's specifically talking about the concept of funky caching, but he captures the concept of coding for PHP as if it were PHP and not (insert favorite language here) better than anyone I've ever seen. In other words, don't try to make PHP into Java, C#, Ruby, etc because if you do you'll fail and you'll hate your life.
Take a look at
How is PHP Done the Right Way?.
I must say that you must first, last, and always avoid the tendency of most beginning PHP developers to use the spaghetti-code anti-pattern. In other words, if you find that you're writing code that contains sql queries, manipulation of data, validation of data, and html output all in a single php script, then you're doing it wrong.
In order to avoid this, it will be helpful to learn something about the nature of web-oriented design patterns. This of course precludes a familiarity with object-oriented programming. But once you've learned the basics of object-oriented programming in PHP, study the MVC design pattern. You don't have to implement this exactly but using the basic ideas of Model-View-Controller will allow you to avoid the blob script problem that most newbies tend to create.
On this point, I would strongly recommend that you take any code snippets you find on the web with a grain of salt. And even if you find it in a book you'll have to consider how old the book is. PHP as a language has advanced quite a long ways and you can't just take code samples at face value because, depending on their age, they may be using workarounds that were valid in 3.x or 4.x but simply are no longer necessary with newer features.
One great thing to do is to study the various frameworks out there. Evaluate what you like and what you don't. Maybe even work up each of the quickstarts that are provided with the framework documentation so that you can start to get an idea of what you like and don't like. And I would strongly recommend that you review the code from the frameworks as well as several other open-source projects so that you can get a feel for how others do things in PHP. Again, take it all with a grain of salt because every PHP developer has their own pet peeves and nuances and none of us is right all the time. In fact, most of the time with PHP there are going to be several pretty good ways to do something.
If you want to get a better understanding of the patterns that are being implemented by the frameworks and are commonly thrown around in the common vernacular on SO, I would suggest that you read Fowler and GoF. They'll teach all about the basic design patterns you'll use in your development efforts.
Specifically watch for the following:
Function files that contain LOTS of functions. This is most likely representative of a need to either put functions directly in the scripts that need them or it may also indicate an opportunity to create some more generic functions that can be made to fulfill the roles of a couple of highly specific functions. Of course, if you're building cohesive, well-encapsulated classes you shouldn't run into this problem.
The do everything class. This is a blob anti-pattern and is really nasty. In this case you need to identify where cohesion and encapsulation are breaking down and use those points as opportunities to break up the class into several smaller, more maintainable classes.
SQL queries that don't use parameterized queries or at least escaped parameters. Very, very, very bad.
Any instance where validation is not being performed or is only performed client-side. When developing for the web, the only way to keep your site and your users safe is to assume that everyone else is a black hat.
A sudden obsessive desire to use a template engine. PHP is a templating language. Make certain that you have clear reasons for adding another layer onto your website before using a template engine.
For further reading please look at the following:
PHP Application Design Patterns
Defend PHP -- useful to give you an idea of the most common criticisms.
Security of strip_tags and mysqlirealescapestring
What should Every PHP Programmer Know
How to Structure an ORM
Best Way to Organize Class Hierarchy
Main Components / Layers of PHP App
Why use Framework for PHP
Recommended Security Training for PHP
Use a coding standard.
Use unit testing. PHPUnit and SimpleTest are the major xUnit systems in PHP.
Be object oriented.
Use version control. Any version control, just use it.
If applicable, use a framework. Zend, CodeIgniter, Symfony, and CakePHP are the major ones.
If no framework, at least use an ORM. Propel and Doctrine are the major ones.
Document. Heavily. Use PHPdoc or similar.
There are a wealth of tools out there for PHP. Please use them, and write good maintainable code. You'll make everyone happier.
Use PDO or mysqli. Using one of these will give you prepared statements, which are safer and more efficient. I can't believe how many examples and tutorials I see using the ancient mysql interfaces. PDO would also make it much easier to switch to a different database system, should you decide to try postgres for instance.
You might look into using Doctrine (http://www.doctrine-project.org). It has a bit of it's own learning curve, but provides very convenient functionality. The handiest parts, for me, are the table creation/test data loading functions. Personally, I prefer to write my own SQL and execute it with PDO, and not use an ORM much in production.
Mainly, learn about SQL and MySQL. http://www.kitebird.com/mysql-book/ this book is excellent. The PHP aspect isn't very intense; PDO takes care of most of it.
Zend Framework's "Coding Standards for PHP" is good starting point. Check also this post.
Your from a Java background, and much of the OO stuff in PHP is very Javaesque. This means many of the design patterns you (hopefully) learnt in Java also apply (to a lesser extent) in PHP. An example for database access would be the DataMapper pattern.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some exposure to CakePHP and think it is a great framework.
Then, I run into this thing called Qcodo. It is another PHP Framework.
I've been hearing Zend alot. They all seem very neat, but I'm wondering what are differences between all these frameworks.
Before I waste too much time learning another framework,
does anyone know pros and cons of each framework?
They all seemed to have the general goal: making web application development in PHP easy, modular, and scalable.
EDIT
Found this interesting comparison result between CakePHP and Zend
I have never heard of Qcodo.
CakePHP is a full featured framework with a lot of automagic, but unfortunately it is one of the slowest frameworks out there. It also doesn't have official forums, and there really isn't that busy of a community. It tries to be a Ruby on Rails clone, but that just doesn't work so well with PHP.
Zend is impressive. It has a strong community and a corporate backing. It is very featured, but it is also very bloated (see that benchmark) so it has moderate performance. From what I hear though, you are able to use the components separately without using the whole framework, and can even use them with other frameworks!
I use CodeIgniter at work and I love it. It is by far the most newbie friendly framework, and with your CakePHP experience it should be a breeze. It has very good documentation that is thorough, clear, and well written. There are a few features that it doesn't have (such as an ORM) that other frameworks have, but CI has one of the most active framework communities I've seen. Since it's easy to write libraries for it, you can find a library to do pretty much anything you want to - ORMs, authentication, etc. To add to this, if you want an ORM for CI, I recommend DataMapper.
You may also want to check out Kohana. It's a spin off of CodeIgniter. It's strictly PHP5 and has an ORM and some more features. Haven't used it myself though, but I have heard good things.
I recommend reading the features of each and determining what you need and looking at code samples of the features you'll be using most.
Some frameworks may seem intuitive to you, but not to others. Selecting a PHP framework is a very personal choice IMO.
I've been using CodeIgniter myself after using CakePHP for some time. The main reason for switching was due to performance, but CakePHP has come a long way in the last few years so that's probably not a valid reason anymore.
[Edit: Apparently, it still has performance shortcomings, see post by ryeguy and comments.]
I've never found Zend to be intuitive and have never looked into Qcodo.
Wikipedia has a list of web app frameworks by language, you might find information to help you decide there as well.
I use both QCodo & Zend Framework
QCodo is a MVC framework of code generator, a lot of codes are ganerated from your database design, and produce ready to use Search & Edit Form for each of your database table. It also handle the database table relationship to pre-generate a set of methods for one-to-many / many-to-many relationship between tables.
Due to these codes were generated from your database design, all the codes were optimsed for each project. In short, It is a framework of database oriented
...................................................
Zend Framework is designed, as far as I know from the founder of this project), to decouple all the models, and indeed they are deploying a lot of ready to use models for different kind of project, from the Zend_ACL (access control list for authenication), to Zend _Search _Lucene, Zend _Service _Twitter, Zend _Service _Flickr, etc). And I think there will be for the future.
My vote for Qcodo! A while ago I did a research to what suited me best, and the result is qcodo, nowadays I can't do a project without considering to use qcodo, or at least his database handling part which is absolutely fantastic.
I think Simfony is the best PHP framework although I have not use it. I used mainly Qcodo/Qcubed but I am moving to Rails, this is why I find Simfony not bad. I tried Code Igniter and is not, it is simple to use, light (I suppose), but it does not have any scaffolding, but this might be changed now. As another guy said you can use an external ORM because CI does not have one by default. Zend Framework has a very modular architecture and has many libraries. I used Zend_ACL but permission inheritance was a pain so I did my own implentation, Zend_Lucene queries did not found the data I needed... ZF is a very low level framework and it needs an ORM too. I had a look at CakePHP but I found it its database interface not at the level of Propel, Qcodo and Doctrine, but I think the you can use your own library.
I usually want in a framework:
ORM and object wrapping the real row in the database ($objUser->Name = 'Jack')
MVC - most of the are MVC
Code generators (Qcodo is fantastic to code generate from the database)
Front controller, routing and url friendly (Qcodo does not have one)
Clean template (Qcodo has $objLabel->Render(); not real tags)
helper methods like link_to, image_tag etc (Simphony and Ruby on Rails)
Database migration to keep track of DB changes
integrated testing framework to test the real application, not few isolated functions (Rails do that and may Simfony)
The community and popularity of the framework.
Most of the advanced PHP developers I met use Simfony, but this is from my personal experience only.
Concluding, I would use Simfony bit I strongly suggest to try Rails using Ruby or JRuby.
Determining the best framework should be a project-by-project decision. If you have a big database using the innoDB engine and lots-and-lots of relationships between tables, check out QCubed (Qcodo). I've seen no framework that handles complex ORM relationships - even reverse relationships with ease! It's also quite fast at handling complex queries (e.g. reverse relationship queries) - although performance in any framework depends largely on the coder's ability to write efficiently.
If you're building a CMS, then you'll want Zend or Symfony for the MVC capabilities. QCubed/codo supposedly is MVC based, but it doesn't seem as clearly laid out as Zend. QCodo also DEPENDS on never changing the structure of your database - One can manage, but it's a real pain to add new fields to a DB table once a site has been launched because it auto-gens custom classes for each table.
I use CodeIgniter mainly because it had really good documentation and has a reputation of being easy to use. Also, Rasmus said it was his favorite, which is admittedly a lame reason, but I've had no complaints.
Don't ignore Symfony, it rocks. I'd say its biggest strengths are a consistent "go with the best practice" approach at every level, a vibrant community and excellent documentation.
I;m using QCubed, the successor to QCodo. Its simply the best you can get out of an Open Source PHP framework. Is quite fast if you know how to make it work. The only downside is that the documentation is lacking. However, the examples site is great. Start using it and I bet you'll have a lot of peace! :)