5

I need to build a php app, and I was thinking about using a framework (never used one before). I've been browsing around some but most of them seems kinda complicated, I really liked what I saw about Symfony, but it looks like I will have to spend like a month until I really understand how to use it, and in one month I could code the app I have in mind 5 times without a framework. But I want to use one to "standardize" my code and prevent bugs.

So I was wondering if someone could share with me which php frameworks you think are easier to learn how to use.

My application will use mysql, and it will have some sort of "search engine" to search data that will be populated on the database using a few "scraper scripts" (that I also wants to code using the framework).

Meredith
  • 920
  • 7
  • 16
  • 31
  • possible duplicate of [What PHP framework would you choose for a new application and why?](http://stackoverflow.com/questions/2648/what-php-framework-would-you-choose-for-a-new-application-and-why) – mario Dec 29 '10 at 03:11
  • I dont want to know why someone would choose a framework, I am giving the reason "easy to learn". – Meredith Dec 29 '10 at 03:13

9 Answers9

6

There are many questions answering this question here on StackOverflow and I was recently just in your position researching many different frameworks as I want to standardize my code as well.

I ended up choosing Codeigniter because I wanted something with good documentation, and that was very light (lighter == easier to understand IMO), and something that was not too strict. In Codeigniter if you really want to you can just code regular PHP and it lets you do that. I like this option because if I really get stuck on something, I just code it in raw PHP the way I know I can. I've only been using Codeigniter for a few weeks but the learning curve isn't too difficult and this is my first framework I've used.

justinl
  • 10,448
  • 21
  • 70
  • 88
  • From what I've been reading it looks like Codeigniter would be good to start with php frameworks, I think I am gonna give it a try, thanks. – Meredith Dec 29 '10 at 03:14
  • 5
    CodeIgniter is a good starter framework; do not forget about Symfony though as once you become an more advanced it will just seem "logical". – Darren Dec 29 '10 at 03:16
  • Yes, Symfony looks like the best one I've seen so far, but also looks really complex, and I want to finish this app quickly. I'll definitely start playing with symfony when I have some free time. – Meredith Dec 29 '10 at 03:19
  • I'd agree with Darren as well. My plan is to get a "feel" for frameworks by jumping in with CodeIgniter. Then once I have a strong grasp of how it works, I can move on to more advanced and powerful frameworks such as Symfony or Zend. – justinl Dec 29 '10 at 03:19
5

Read through some of the previous discussions, and look out for ease of use advises:

If you want something easy to get started, you might want to look into the minimal frameworks:

But actually the big dozen are advisable if you want good documentation. Symfony and CakePHP are complex, CodeIgniter and the newer Kohana fork are beginner friendly. While there are many more to choose from. Pick a nice API, and maybe look out for one that explains the difference between MVC and MVP. Also for a lengthy list: http://matrix.include-once.org/framework/

Community
  • 1
  • 1
mario
  • 144,265
  • 20
  • 237
  • 291
3

My first choice would be cakePHP. Easy to learn, great documentation, api and a few good books:

tersmitten
  • 1,310
  • 1
  • 9
  • 23
3

CakePHP is the best solution with a small learning curve.

christopheml
  • 2,444
  • 17
  • 25
Ajay Patel
  • 791
  • 11
  • 24
2

I was in your shoes just 2 years ago. I personally chose to use Zend Framework. It's important to understand that ZF is built by the same guys who maintain and improve PHP itself! Just that gives it a lot more credibility.

When choosing a framework you should consider the following:

  1. Size and Quality of the community - Being one of the most widely adopted PHP frameworks, Zend Framework (aka ZF) has the biggest PHP framework community; hence, most of the problems you will encounter will have already been answered. There are frameworks out there that are supported by just a few developers and if they happen to quit working on it, you're stuck with the latest version of the framework. This not likely to happen with ZF.

  2. Documentation and Beginner Friendly - The ZF docs are pretty good, full of examples and beginner friendly. There's also a ton of tutorials and [quick start guides][2]. It's extremely easy to start up a new ZF app.

  3. Investment - Sure you have to invest sometime learning how it works, but everything's like that in the software engineering world. You have to understand [OOP][3] and [MVC][4] before hand as well. Many people don't understand that using a framework to develop procedural-like code (instead of OOP) is defeating the purpose of... using a MVC/OOP framework! Therefore, it's important to grasp and master these concepts so you develop the best code possible. And by best code I mean a) code that works b) code that's easy and fast to understand and maintain.

This investment is well worth it since it will drastically increase a) speed of development b) speed of debugging and maintenance.

Also, take advantage of this moment in your programming career to also adhere to other common best practices (if you haven't already done so) by using: a) Unit Tests - incredibly easy to integrate within ZF. Look into [Test Driven Development][5] as well. b) An IDE - VIM, [Netbeans][6], etc c) [Design Patterns][7] d) Source Control - [Mercurial][8], Git, SVN, etc e) Finally, keep yourself in the loop by [following what's going on the PHP world][9].

You'll thank yourself yourself in your near future! I know I did.

Freddy Duarte
  • 177
  • 2
  • 9
2

As no-one has voted for Symfony here i will and here's why. There are two types of frameworks, well a whole range actually but in the PHP/MVC area which is where we are in this thread there are Glue and Full Stack frameworks.

Zend and CodeIgniter are Glue and Symfony and Cake are FullStack.

Glue are the ones where you can pick and choose which components you can use and how much "standard" code you can use. These tend to have a gentler learning curve as you can pick the bits you like that help and fill in the more difficult bits with code you know.

FullStack means you need to use the lot and so the learning curve can be quite steep. Also with FullStack there can be a tendency to balk against the way something is implemented rather than just accept and flow with it.

Coming from a write everything myself background i initially favoured the Glue's but have now migrated to FullStack using Symfony 1.4 and 2 and Sinatra and Padrino. The extra speed and power the fullstacks give is not something i would like to give up.

One downside of CI is that it is built for php4 compatibility and so does suffer in a number of structural ways when you come to push the framework, Kohana is a fork that addresses this issue. And i dislike Zend because there are so many ways of doing the same thing that after a while the Framework seems almost irrelevant (Sorry personal rant)

At the end of the day use of a Framework is good because it adds a structure and can be a great aid to learning and the one to choose is the one you feel comfortable and are productive in.

PurplePilot
  • 6,652
  • 7
  • 36
  • 42
1

There are many frameworks and several really cool frameworks. After trying so many of them I think you should not start using any of them before finding best suitable to your needs. You may find any other after choosing one so do not act quickly before choosing right one. Before creating an application with a framework you should make exercises. For me I started with CodeIgniter created one application and left second one in the middle, then passed to Kohana and started second application according to the needs.

Sinan Eldem
  • 5,564
  • 3
  • 36
  • 37
0

The framework must have little learning and easy to expand. I am using http://sourceforge.net/projects/naanalframework/ for all my projects. There is no installation. Just has to point the frameworks naanal.php in your application's index.php and run it. The framework will guide you what to do. For the beginer, this framework is very useful to develop PHP applications. A sample application also available at http://sourceforge.net/projects/naanalframework/files/sample%20applications/wordpress_plugin_builder.zip/download

0

CodeIgniter is the one that I prefer

sethvargo
  • 26,739
  • 10
  • 86
  • 156