PHP on Rails

The funny thing about working with Ruby on Rails is that its made me a better PHP developer.

A client wanted something developed and chose being able to support the app with their in-house PHP experience over Rails’ speed of development. I’m now using tools like DB_DataObject to emulate some of what I love about ActiveRecord. I’m making each PHP file its own controller, and using Smarty for the V in MVC. If you look at my include directory it looks suspiciously like a Rails directory.

Yes, I know about Cake, but I only have so much time to invest in learning frameworks, and I still prefer Rails.

10 Replies to “PHP on Rails”

  1. I’ve observed this too, though I’m still slogging through tutorials (though I’ve been moving perpetually for the last two months, so I haven’t had time to dig in deep) … but as I’m learning Rails, I’m becoming a better web developer.
    I’d already figured out the V part of the MVC with Smarty, and a little bit of the MV, but hadn’t fully separated those out b/c I wasn’t thinking in that pattern, I was just sort of evolving to it — learning Rails is like hitting fast-forward on the learn-as-you-go approach to web development. 🙂

    Reply

  2. I was using DB_DataObject/Smarty and a MVC approach about a year before I found Rails. It is a pretty good way to approach a PHP app. I still prefer Rails however on my newer projects. Rails feels more mature and stable to me.
    Good luck with your code!

    Reply

  3. Ha. This is exactly what’s been happening on my end too. Ruby on Rails and Django made me rethink and redo a few of my PHP apps to make it more MVC-y and upkeepable.
    Of course, organization and structured thinking is always a good thing.

    Reply

  4. so there’s no easy way to do CRUD operations in PHP other than fiddling with DB_DataObjects/QuickForm/Smarty to come up with something for your self ? I thought the guys at PEAR would hopefully make something for that purpose so one can integrate it in his/her framework, because it’s so common in webdev, but Noo..last time I checked, they still prefer the the hardcore way..oh well..sighs

    Reply

  5. There are other ORMs for PHP if your complaint is about lack of choice, oth.

    Reply

  6. AFAIK, none of those generate forms ( perhaps DB_Table )

    Reply

  7. Yes Yes! Sign me up or whatever. I’ve been fiddling with a RAD framework for PHP that I’m calling Xaypole. And just today got to see a rails demo that made me salivate like hell.
    I’m bookmarking you, and Cake too. PHP deserves a slick, extensible MVC CRUD package. Are you using PEAR standardS?

    Reply

  8. Hey George, that link you suggested http://www.wiki.cc/php/Object-relational_mapping is really awesome!! thanks for that. The last one in the list POG is what I found useful because I don’t have to download anything. I use their online generator thing. It’s not bad actually..

    Reply

  9. FWIW, I recently stumbled on a framework that seems to pack most of the RoR punch … Qcodo
    Very excited as I have zero time to learn a new language right now.

    Reply

  10. If you know and love RoR then why not just use PHP on Trax? It’s file structure is exactly the same as rails and most of the syntax is the same, nothing new to learn, all the benefits of Rails, but in PHP. 🙂 And best of all is its Active Record has all the table associations built in and u declare the associations the same as RoR. check it out http://www.phpontrax.com

    Reply

Leave a Reply