PHP Framework for RESTful Web Service [closed]

I have been going round in circles with this question for days – which is the best PHP framework to use to create a RESTful Web service?

I’ve trawled the web for info and have come across three main factors that are important:

  • must have REST architecture built into the framework
  • must be a stable application
  • must be full featured

It may be that what I want does not exists, but I wanted to check with the community to see of I had missed something.

Currently the three contenders are:

CodeIgniter

Is a very stable framework with a large community and plenty of features and ‘extensions’. Issue is that it’s not RESTful. I have found a RESTful controller but there are a few things that I don’t like about it. Mainly that it does not seem to correctly use the HTTP methods as per the RESTful architecture definition. I think this stems from restrictions in the CodeIgniter core though.

Yii

Again, seems like a large community and is stable with plenty of features, but not RESTful.

Laravel

A framework that is RESTful straight out of the box, and it has a good amount of features. The issue is that this is a relatively new framework so lacks stability.

Other frameworks I’ve considered:

Zend – from what I’ve read, avoid unless writing Enterprise software.

Recess – RESTful, but seems very inactive and under used.

UPDATE:

In the end I went for Laravel. Can’t recommend it enough! I had a RESTful API up and running in a week and also a simple web client. Amazing framework.

3

Zend Framework is the obvious choice, it’s the more well designed, mature and stable of the frameworks you list, and perfectly suitable for RESTful applications. That said and although I’ve build numerous apps with it and not just “Enterprise” applications, it’s notoriously hard to get the hang of and it might just not be your cup of tea. There was a significant effort to simplify it recently, but had I not been an early adopter I’d probably stay far away from it.

CodeIgniter, a framework I’ve used extensively, isn’t really a good choice. As you’ve already noticed it doesn’t offer a RESTful architecture out of the box, and you are quite right in assuming that the design of the core makes any custom RESTful design a bit tedious (the lack of a HTTP Request class comes to mind). It’s not impossible, far from it, but CodeIgniter’s main attraction, its ease of use, becomes a lot less attractive when you have to write tons of custom code to do relatively simple things that most other frameworks support out of the box.

Which brings us to Laravel, the newest addition to the endless list of PHP frameworks. I must admit I haven’t used it extensively, but from what I’ve seen so far stability is not an issue. It’s a bit idiomatic, but it does provide REST out of the box and Eloquent, its ORM, is awesome. I went with Laravel from my latest application, that has some RESTful components, moving on from my usual Zend Framework + Doctrine combo, but this is my first non throwaway application with the framework and I’m still not 100% comfortable with it.

If you feel Zend Framework is too much for you, Laravel certainly seems like a worthy contender. If you don’t want to invest in a relatively new project then there’s another option that you missed in your research, Symfony. It sits somewhere between Zend Framework and CodeIgniter when it comes to learning curve, and it’s as stable as it gets. The FOSRestBundle offers a simple but complete REST API basis for Symfony, and it might just be exactly what you are looking for.

At the end of the day, it’s completely up to you and it’s not a decision you can take lightly. Its framework imposes architectural choices that you’ll have to live with for as long as you are using it, and for comparably mature frameworks more often than not it boils down to personal preference.

Good luck 😉

4

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