Introduction to Fuel
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Introduction to Fuel

on

  • 4,501 views

 

Statistics

Views

Total Views
4,501
Views on SlideShare
4,475
Embed Views
26

Actions

Likes
5
Downloads
40
Comments
1

5 Embeds 26

http://a0.twimg.com 9
http://paper.li 9
http://safe.tumblr.com 4
http://sharkpp.tumblr.com 3
http://www.plurk.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • on page 14 `oil generate` command it seems lost `posts` after scaffold and losts `oil refine migrate` command.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Introduction to Fuel Presentation Transcript

  • 1. Introduction to Fuel Phil Sturgeon philsturgeon.co.uk | @philsturgeon
  • 2. WTF is Fuel?• A “new” PHP framework• “Combines the best of multiple frameworks”• Fresh start• PHP 5.3 only• Made by a bunch of CodeIgniter guys
  • 3. It’s freaking brilliant!• Incredibly lightweight• Easy to learn• Huge community• Helpful forums• Backwards compatibility is key• Minimal dependencies• PHP 5.1.6
  • 4. It’s PHP5ier!• Still lightweight• Everything is a class• No more $ci =& get_instance();• PHP 5 autoloading - no loader! CodeIgniter Fuel$this->load->library(session); Session::get(foo);$this->session->userdata(foo);• Authentication + Hierarchal MVC (HMVC)• “Everything” is a driver
  • 5. • Cascading file system• No namespacing - OAuth_Provider_Facebook - OAuthProvider_Facebook• Splintered: v2.4 versus v3.2• Great DB builder, not loving the ORM
  • 6. We stole it!• Improved Cascading File System Autoloader::add_classes(array( Mongo_OdmCollection => __DIR__./classes/collection.php, Mongo_OdmDatabase => __DIR__./classes/database.php, Mongo_OdmDocument => __DIR__./classes/document.php, Mongo_OdmJSON => __DIR__./classes/json.php, ));• Added Namespacing class Config extends FuelCoreConfig {}• Modules = Routable ‘mini-applications’• Packages = Installable ‘gem’-like class collections• Recycled a few other bits • Views • OAuth • Num (Credit card masking and other bits)
  • 7. • Command-line tools• Database Migrations and ORM bundled in• Twig = awesome parser• Namespaces by the metric fuck-ton namespace AcmeHelloBundleController; use SymfonyComponentHttpFoundationResponse; class HelloController { public function indexAction($name) { return new Response(<html><body>Hello .$name.!</ body></html>); } }
  • 8. • Command-line utilities and tasks $ oil refine robots:protect• Migrations • Database "PROTECT ALL HUMANS" _____ / • Mongo /_____ • Whatever ____[*---*/]____ / # _____/ /# / / # _.---._/ #/ • ORM - lighter and quick / /| | | /| /___/ | | | | | | ___ | | | | |---| | | | |• Twig, HAML, Mustache, etc |__| _| |_#_| |_/ |__| // < _//^_ /> // ||/ |//// /| ||/• Simple Namespaces | | | | • FuelApp |---| |---| • FuelCore |---| | | |---| | | • Auth |___| |___| • Orm / / |_____| |_____| • Oil |HHHHH| |HHHHH| • each module / package
  • 9. // old usage still valid, will load app/views/example.phpView::forge(example);// load a Mustache template, will load and parse app/views/View::forge(example.mustache);// load a Twig template, will load and parse app/views/example.twigView::forge(example.twig);// load a Jade template, will load and parse app/views/example.jadeView::forge(example.jade);// load a Haml template, will load and parse app/views/example.hamlView::forge(example.haml);// load a Smarty template, will load and parse app/views/View::forge(example.smarty);// load a Dwoo template, ATTENTION: this one expects app/views/View::forge(example.dwoo);
  • 10. • Beautiful command line • Conventions through the nose• Interactive Debugging • How the f**k does that work• Package installation • Gem conflicts = AGGHHHH!• http://rubygems.org/ • Consult a wizard if it breaks• Scaffolding • ORM restrictions?• ORM - perfect for RAD
  • 11. • Beautiful command line • No conventions• Interactive Debugging • Simple OOP• Package installation • Application specific packages• http://cells.fuelphp.com/ • Pretty exceptions• Scaffolding • Scaffold templates• ORM - perfect for RAD • DWTFYL ORM
  • 12. $ oil create blog$ cd blog$ oil generate scaffold title:string summary:text body:text
  • 13. DHH DH
  • 14. Any Questions?Thanks for listening!philsturgeon.co.uk | @philsturgeon