PHP frameworks – should I use them? [closed]

First of all let me explain who I am: I am a PHP Developer working for a company developing their CMS which handles online stores, data feeds and other content like blogs. I have been programming for 6 years and 4 of those have been in PHP. (I used to be a C# developer).

My question is regarding PHP frameworks. I see so many jobs asking for zend, cakephp and other MVC types of frameworks. However, even as an experienced developer I have never used a PHP framework. Should I start learning? If so where do I even start as there are so many.

I am about to re-write so much of my work’s CMS and I’m wondering whether I could help myself a lot by using a framework. What do people think? Considering I will be re-writing a lot of the online store stuff…
I am experienced in OO and I have used the .NET framework in the past.

Thanks in advance for the replies.

In general, a framework is a tool which helps you to avoid reinventing the wheel, thus being more productive. In a particular case of PHP, a framework is also a way to abstract and hide some stupidities and inconsistency of PHP itself, while having a side effect to encourage some people to adhere to best practices in a context where the language itself encourages rather poorly written, poorly architectured code.

So yes, a PHP framework is definitely a thing you should learn if you want to be qualified as an experienced PHP programmer, while the choice of using it or not is up to you for every project you work on.

where do I even start as there are so many?

Learn two or three popular ones. Once you know those quite well, it wouldn’t be difficult:

  • To know which one should fit a particular need for a given project,

  • To quickly discover less popular ones and see in which situations would they be more valuable compared to the ones you already know.

3

It seems to me that the choice to use PHP will lead to you either using someone else’s framework or building one.

“Framework hell” is a very real problem (or set of related problems) that are not unique to PHP, and there are no “silver bullet” frameworks. In short, all frameworks are 90% solutions in the end; Early progress in developing with a framework will almost always be faster than without. Getting the last 10% of the way is going to be either (a) really hard or (b) consist mostly of giving in and letting the framework win, and decide some elements or limitations of your design.

I say all of the above without saying that any framework is great, or bad. Such a question is unanswerable. Try a framework on a small project or a small chunk of your big project, and see if it fits. Be ready to kick it to the curb if you determine it doesn’t work for you.

There are enough frameworks for PHP that you could probably evaluate them forever. But sooner or later you’ll find one that’s close enough. Close enough is enough for Rock and Roll, and many PHP websites.

What web frameworks do is wrapping all the request-response-cookie-session stuff into an API. So you get an easy interface to work with.

Some have more battery included and provide librairies to handle forms , databases , validation ,etc …

My opinion :

  • if you have a lot of legacy code : chose a micro-framework that will help you organize php code : slim , lavarelle , silex , …

silex is great since it’ll help you learn Symfony at the same time.

If you have time , learn big stuffs like ZF or Symfony.

A big frameworks usually means a complete stack. For instance learning symfony means learning Doctrine, Twig , Assetic, using Composer ,monolog,… so people hiring you know you know all that stuff.

Frameworks are great for reducing ramp-up time. Using a well known package and following industry-wide conventions is the difference between a developer new to the project making meaningful contributions within hours vs. days, or even weeks.

Whether you should ‘learn frameworks’ or not… no one here can tell you what you will need to know in the future. I’ve been coding in PHP for over 10 years, and have never needed to use a 3rd party framework. The types of projects I work on just dont call for it. A lot of projects fall into that category.

That said, its important that you understand what the frameworks are doing. Whether you do that by learning existing frameworks, or creating your own… thats what you should really be after. Dont assume you’ll be working in PHP or C#, for example, 10 years from now. Understanding the concepts behind the frameworks will be what moves you forward. Knowing the specifics of XYZ framework wont help you unless you expect to be locked into your current technology stack.

2

As someone who was recently in the same position, I would definitely encourage you to go with a framework. When I started with my current company a few years ago I didn’t really see the point to using one – after all I was the only developer at a fairly small firm. Fast forward a few years and now I’m in charge of a team of developers, and we have a small army of websites, web apps, client projects, APIs, social apps and CMSes supporting offices in four countries. Having one or two frameworks that everyone can work from as a base makes us far more productive, and makes it easier to recruit people when we need them. It also allows us to more easily jump from one project to another when deadlines shrink or something else comes up.

My advice is to spend some time trying out a few frameworks. Try to make the same relatively simple site that has basic versions of the PHP functionality you need. Once you get through this with a few templates you will start to get a feel for which ones suit your needs and personality as a coder.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật