views:

292

answers:

7

I've been working a lot with Ruby on Rails in the past several months, and am loving it. Recently however, I've come into some work that requires PHP, and would like to retain a lot of the nice baked in features that Rails provides, such as:

  • Restful Routes
  • Easy Model Validation
  • Good Application Layout
  • Helpers and Observers

Are there any PHP frameworks that offer all (or most) of the above? Which are most similar to Rails?

+5  A: 

Checkout symfony. It is Rails-like and is built upon a strong MVC foundation, with an advanced routing system, extensible helpers, and great form system for validation. It supports both Propel as Doctrine as ORMs with a large cluster of plugins.

Disclaimer: I worked on symfony for some time, so I may be biased in a recommendation.

carl
+3  A: 

I believe that CakePHP was started with the express purpose of mimicking Rails, so there's a good place to start.

nickf
I agree with you, but can you site that?
mgroves
+1  A: 

I might suggest CodeIgniter as well (there are no generators though...)

Take a look at http://stackoverflow.com/questions/350232/symphony-vs-cakephp-which-one-is-closest-to-php

SeanJA
A: 

I'm afraid your question is flawed. Ruby and PHP are quite different languages, so what works well in one doesn't necessarily work well in the other. There are some frameworks, which tries to duplicate Rails, but I think you'll find that it has more the feel of a cheap copy, than anything.

In particular, Maintainable Framework looks like a 1:1 clone of Rails. CakePHP and Symfony have borrowed heavily as well, so you might find those worth investigating.

troelskn
A: 

You should check FLOW3, a upcoming MVC Framework developed by the TYPO3 Core team for TYPO3 5.0. It has some awsome features like dependencie injection, nice validations and routes.

They plan to integrate rails-like migrations;-)

But actually it's in alpha state, so it won't be useful for production use at the moment.

Check out more informations at www.flow3.org

+3  A: 

Try YII Framework

Some features

  • MVC
  • DAO/ActiveRecord
  • I18N/L10N
  • caching
  • jQuery-based AJAX support
  • authentication and role-based access control
  • scaffolding
  • input validation
  • widgets
  • events
  • theming
  • Web services
  • Written in strict OOP
  • High Performance

I use this Framework and it works 100% for me.

Roland
+1  A: 

I have used both CakePHP and Rails and they are quite similar but as mentioned above, the underlying language makes a big difference. I suspect they will all feel pretty different no matter how close they are conceptually.

Mike Williamson