Successfully reported this slideshow.
Your SlideShare is downloading. ×

Introduction to Fuel

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Merb
Merb
Loading in …3
×

Check these out next

1 of 16 Ad
Advertisement

More Related Content

Similar to Introduction to Fuel (20)

Advertisement

Recently uploaded (20)

Advertisement

Introduction to Fuel

  1. 1. Introduction to Fuel Phil Sturgeon philsturgeon.co.uk | @philsturgeon
  2. 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. 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. 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. 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. 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. 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. 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. 9. // old usage still valid, will load app/views/example.php View::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.twig View::forge('example.twig'); // load a Jade template, will load and parse app/views/example.jade View::forge('example.jade'); // load a Haml template, will load and parse app/views/example.haml View::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. 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. 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. 12. $ oil create blog $ cd blog $ oil generate scaffold title:string summary:text body:text
  13. 13. DHH DH
  14. 14. Any Questions? Thanks for listening! philsturgeon.co.uk | @philsturgeon

Editor's Notes

  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

×