September 26, 2005

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.

Posted by george at September 26, 2005 09:20 AM
Comments and TrackBacks

TrackBack URL: http://mt.gnerd.net/mt-gnerd-tb.cgi/2693

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. :)

Posted by: Scott T. at September 26, 2005 12:57 PM

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!

Posted by: Mike Zornek at September 27, 2005 10:28 AM

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.

Posted by: David Chien at September 30, 2005 03:05 AM

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

Posted by: oth at October 4, 2005 02:39 PM

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

Posted by: George Hotelling at October 4, 2005 06:13 PM

AFAIK, none of those generate forms ( perhaps DB_Table )

Posted by: oth at October 5, 2005 05:54 AM

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?

Posted by: Matt C at October 14, 2005 01:02 PM

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..

Posted by: Amar at November 4, 2005 07:51 PM

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.

Posted by: MikeR at November 7, 2005 05:07 PM

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

Posted by: john at November 15, 2005 12:40 AM

Sorry, comments are closed.