FuelPHP - Oil Introduction & Scaffolding

Posted: 2011-03-06
Category: FuelPHP

Development of FuelPHP has come a long way since Dan and myself started work on the system a few months ago and it's command line utility has progressed amazingly. I spent all of yesterday polishing off this package and now we have Rails-style scaffolding and migrations working perfectly. This video shows off the basic functionality of Oil by running through scaffolding creation and quickly brushing on migration work.

You can see here I have created a basic controller with template support, my model, all of my basic views, the schema and even run the schema just by using two commands:

$ php oil generate scaffold monkey name:varchar[100] biography:text favourite_number:integer
$ php oil refine migrate

I could then deploy this code (maybe with git) and run the migrate command on the live server and those features would be live!

If you are not used to this way of working it borrows heavily from Rails which I have been doing a fair bit of work with recently. I don't want to start  massive PHP vrs Ruby argument because there is nothing new to be said here, but suffice it to say we don't always have the option to work with Ruby. FuelPHP is taking ideas from Rails in how the command line utility works and helping to speed up PHP development. For me that is pretty exciting!

I'll be posting more screencasts soon focusing on other aspects of Oil, covering the console and migrations in more detail. I'll also be working on a write-up for setting up Readline for PHP so you can interact with the Oil Console like it is part of bash.

Comments

Gravatar
Kyle

2011-03-06

Nice screencast, very helpful. I didn't see an index.html in your IDE. Is that a php 5.3 thing, or am I missing something?

Gravatar

2011-03-07

Where are you expecting to see a index.html and why?

Gravatar
Michael Grech

2011-03-07

Sweet, this was the one thing I always felt was missing from CI. It will be nice to rollback my db along w/ my source code.

Gravatar
Whmeroe

2011-03-07

Great work so far! I downloaded beta 1 and tried the command above. It builds the model and controller, but not the views nor template. No errors. Thoughts?

Gravatar

2011-03-07

Michael Grech: I don't think it is really missing from CI, it's just not that kind of framework. In the world of Ruby two of the most popular frameworks are Sinatra and Rails. Rails does a LOT of stuff, has generators and all sorts of crazy extra's while Sinatra is RIDICULOUSLY stripped down and basic. The two have different uses and that works :)

Whmeroe: This demo is showing off the current Fuel build available in Git at the time. The beta1 was tagged ages ago and a fair bit has happened since then. We haven't tagged a new beta as we have more changes to make to unit testing and ORM, but on the whole most of it is stable.

Gravatar
Zac

2011-03-15

Really loving see this framework come along! Great work

Gravatar
Benjamin Bowles

2011-03-16

This really does show off the powerful elements of Fuel, time to jump ship from CI I'm thinking.

Rails was too much of a learning curve for me.

Gravatar
Rostislav

2011-03-17

This sounds great. How's the second beta coming along :)

Gravatar
Don Gilbert

2011-04-08

Fuel is coming right along. This looks very promising. I've been researching different frameworks, and I'm convinced Fuel is the way to go.

Gravatar
Chirdeep

2011-05-25

Simply brilliant, Rails for PHP. It is a trend setter for PHP frameworks.

Gravatar
Shawn Mccool

2011-08-02

It's nice to see a framework that shares my sensibilities.

Gravatar
Rajan Chandi

2011-08-10

Sounds like a great new framework!

How efficient that would be as it gets developed?

Will it match 1 MB RAM or will be bigger?

We've been developing in rails but need to be moving to PHP for better speed!

Gravatar
Video Critizism

2011-08-24

wow, php world now learned abou rails? quite late, however it would be nice if you could upload HD videos - there is no sense in a video upload if it is totally garbled and nobody can really see what happens on the screen - also please think before recording what you want to say and do not babble so much unneeded stuff, keep your words short and precise and do not talk like a grandma at applepie and coffee. Thanks.

Gravatar
Jason

2011-08-24

@Video Critizism: complain much? Go crawl back under the bridge you stupid troll.

Gravatar
Phil Sturgeon

2011-08-24

Video Critizism: Way to be a dick you anonymous coward. These were some quick tips, I don't have time to sit around all day recording this shit for free just for poops and giggles. It gives people a quick idea of how this framework works. If you don't like it feel free to shut the fuck up.

Gravatar
Mera

2011-09-02

Nice screencast, very helpful

Gravatar
Glenn Williams

2012-02-06

Brilliant tutorial. Thanks!

Fuel PHP is great.

Gravatar
Jordan Arseno

2012-02-20

Very Railsesque, Phil. Nice work!
Just cloned the main repo and I'll be moving over from CI any time now to give it a shot!

Posting comments after three months has been disabled.