FuelPHP - a PHP HMVC Framework by silicongulf.com
Upcoming SlideShare
Loading in...5
×
 

FuelPHP - a PHP HMVC Framework by silicongulf.com

on

  • 14,947 views

One of the latest PHP frameworks is FuelPHP. It is a combination great ideas from other frameworks (CodeIgniter, Kohana, Ruby on Rails) with a special twist. This is part of our course curriculum at ...

One of the latest PHP frameworks is FuelPHP. It is a combination great ideas from other frameworks (CodeIgniter, Kohana, Ruby on Rails) with a special twist. This is part of our course curriculum at SiliconGulf.com.

Statistics

Views

Total Views
14,947
Views on SlideShare
14,744
Embed Views
203

Actions

Likes
3
Downloads
135
Comments
0

6 Embeds 203

http://www.sfexception.com 173
https://twitter.com 23
http://a0.twimg.com 3
http://localhost 2
http://www.plurk.com 1
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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…
Post Comment
Edit your comment

FuelPHP - a PHP HMVC Framework by silicongulf.com FuelPHP - a PHP HMVC Framework by silicongulf.com Presentation Transcript

  • FuelPHP CHRISTOPHER JOHN CUBOSWEB DESIGN AND DEVELOPMENT MONTH (AUGUST 2011) COLLEGES & UNIVERSITIES DAVAO CITY PHILIPPINES FuelPHP HMVC Framework August 2011 www.silicongulf.com
  • Who is Chris Cubos • Started programming at age 10 (1985) • Created his first website (1995) • The first web designer/developer in Mindanao • Been doing this for 26 years and still learning • Won the first web design competition in the Philippines (1995) held in Cebu City • Developed his first CD-ROM application (1996) • Developed his first flash site (1995) … forward to the presentFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Tech Stuff • Languages: Q/BASIC/A, Pascal, C, C++, Assembly, PHP, JavaScript, VBScript, ASP, AutoLISP, Lingo, ActionScripting, etc… • PHP Frameworks: CodeIgniter, FuelPHP • CMS: Wordpress, Drupal, Joomla, Mambo, etc • Applications: Photoshop, Dreamweaver, Illustrator, AfterEffects, Premiere, CS, etc…FuelPHP HMVC Framework August 2011www.silicongulf.com
  • 1st Web Development Company • Won the Philippine Webby Awards for Multimedia Category • Won Davao Web Design Competition in multiple categories and the overall best web design • 1st Company to develop flash based applications • 1st Company to develop multimedia CD-ROMs • 1st Company to develop web portals • 2nd Company to develop a PH search engine • Won multiple awards in web design, logo designFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Yes the present • He currently devotes his time helping students enhance their skills with the non-profit organization called the SiliconGulf Initiative • He is also organizing large I.T. events in the Davao and currently organized the most number of I.T. events in a single month. • Furthermore, he is currently developing the the first game-based training center in MindanaoFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Brewing • We are currently developing the first game-based training center in Mindanao • Multiple mobile apps and games • Organizing multiple upcoming I.T. eventsFuelPHP HMVC Framework August 2011www.silicongulf.com
  • What is Fuel PHP? • Fuel is a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start. • The framework was started in late 2010 by Dan Horrigan then shortly after the team grew to include Phil Sturgeon, Jelmer Schreuder and Harro Verton. The team has decades of PHP experience between them and have all been involved with Open-Source projects such as CodeIgniter, PyroCMS, ExiteCMS and DataMapper ORM to name but a few.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Basic Facts • 9 months in the making of (1.0) • 24,155 lines of goodness. • 40+ developers contributed • Community driven • Based on ideas from CodeIgniter, Kohana and Rails but totally rewritten from the ground • Lightweight (800kb.gz) • Load what you need • Configuration over convention • No automagicFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Why I Choose FuelPHP • Quality of code (very sexy) • Coding standards • Lightweight (smallest footprint 856kb) • Performance – Load only what is needed – Short travel for each code execution • Easy to create your own libraries • Responsive community • Flexibility to adapt to MY styleFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Getting Started: Download www.fuelphp.com • Framework • Documentation • Packages – Oil – Auth – ORMFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Requirements • Web Server – Apache running on *nix. • Database • PHP Version – 5.3.2 • mod_rewrite – For clean and seo-friendly URLs • PHPUnit – 3.5.12 (for testing) • Works easily with WAMP and XAMPPFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Installing: Windows • Install WAMP or XAMPP • Download Fuel PHP • Run!FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Recommended Tools • Adobe Dreamweaver • CodeLobster • E-texteditor • Komodo • Eclipse • Google Chrome • WAMP • Notepad++ • NavicatFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Your First AnimationClicking your way through Adobe Edge
  • FuelPHP MVC • MVC is an approach to separate code depending on what role it plays in an application • The application starts by loading a Controller • That Controller executes a method which retrieves data using Models • Once done, the controller decides what View to load, it contains the output the visitors get to see • Clear separation of design and business logicFuelPHP HMVC Framework August 2011www.silicongulf.com
  • How does MVC work? Controller View ModelFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Controllers • Fuels routing decides based on the requested URL what controller to load and what method to call upon it. • The Controller decides what actions to take, what to do with any user input, what data gets manipulated and which View is shown • The Controller does none of these things itself however; it calls upon Models and Classes to do the work.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Models • Models contain data that needs to be processed Create, Read, Update and Delete (CRUD) • A Model is a representation of some kind of data and has the methods to change them. • Never put SQL queries in a Controller, those are put in the Model and the Controller will call it. • If your database changes you wont need to change all your Controllers, just the Model.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Views • Views contain your HTML, which should never be found in your Controllers or any other class that is not specifically meant to create output • Separate your design from your logic • Change the layout and look through the Views • Views can contain loops, results, forms and the overall design and layout of the site.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • ViewModels • When your application gets more complex youll discover that it gets hard to decide if a piece of logic really belongs in the Controller • What if it is very specifically about the View and has little to do with your application logic? • This is where ViewModels come in; they are the glue between your controllers and your views.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • HMVC Requests • HMVC requests are a great way to separate logic and re-use controller logic in multiple places. • One common use of this is when you use a theme or template engine to generate your pages, where every page is divided into sections, and sections are populated by widgets. • By using modules to produce the widget output, you can create a highly modular application, with easy to re-use components.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Let’s Code .. Not!!! Excited, heheFuelPHP HMVC Framework August 2011www.silicongulf.com
  • OIL • Generate - Build MVC components, migrations and entire scaffolding. • Refine - Run tasks such as migrate and your own custom ones. • Package - Install, update and remove packages. • Console - Test your code in real time using an interactive shell.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Things you need to do • Create a database (PHPMyAdmin/Navicat) • Configure database (/fuel/app/config/db.php) • Add ORM (/fuel/app/config/config.php) • Create basic CRUD site with OILFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Creating Tables and CRUD > php oil g scaffold users username:varchar password:varchar sex:tinyint Creating model: C:wampwwwfuelphpfuelappclasses/model/users.php Creating migration: C:wampwwwfuelphpfuelappmigrations/001_create_users.php Creating controller: C:wampwwwfuelphpfuelappclasses/controller/users.php Creating view: C:wampwwwfuelphpfuelappviews/users/index.php Creating view: C:wampwwwfuelphpfuelappviews/users/view.php Creating view: C:wampwwwfuelphpfuelappviews/users/create.php Creating view: C:wampwwwfuelphpfuelappviews/users/edit.php Creating view: C:wampwwwfuelphpfuelappviews/users/_form.php Creating view: C:wampwwwfuelphpfuelappviews/template.php > php oil refine migrate:upFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Controllers (davaoit.php) class Controller_Davaoit extends Controller { public function action_index() { $data[‘title’] = ‘Welcome to Davao IT’; $data[‘content’]=‘We are a group of great developers’; $data[‘nav’]=array(‘home’, ‘about’, ‘contact’) $this->response->body = View::factory(‘davaoit/index’, $data); } }FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Views (davaoit/index.php) <html> <head> <title><?php echo $title;?></title> </head> <body> <header><?php echo $title;?></header> <nav><?php $nav;?></nav> <article><?php echo $content;?></article> </body> </html>FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Showcase: What we’ve done. • DEMO: Social networking site using • DEMO: Game-based learning system • DEMO: Photo Gallery • DEMO: Basic user authenticationFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Social Network (development)FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Photo Gallery (under development)FuelPHP HMVC Framework August 2011www.silicongulf.com
  • What Others have done • http://lumberhandling.com/ (corporate site) • http://poll.froedge.com (online poll) • http://pastecode.com (cut and paste code) • http://wtfismypagerank.com (pr checker) • http://mjs.me/ (url shortener) • http://www.scrapyrd.com/ (code snippets) • http://www.amwaitingfor.com/ (community) • http://www.colorfyit.com/ (analyze site colors)FuelPHP HMVC Framework August 2011www.silicongulf.com
  • What’s next • Try something in OIL • Modify it • Read docs • Create some apps • Repeat and master • Join forums • Search the netFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Thanks Oops… There’s moreFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Full year of IT Events August 2011: Web Development Month September 2011: Mobile Application Month October 2011: Animation Month November 2011: Bloggers Month December 2011: SEO Month January 2012: Technopreneurship Month February 2012: I.T. Education Month March 2012: I.T. Career Month April 2012: Gaming Month May 2012: Graphic Design Month June 2012: Hacking and Network Security Month July 2012: Software Development MonthFuelPHP HMVC Framework August 2011www.silicongulf.com
  • August I.T. Events by PGO University of Southeastern Philippines (USEP) Friday, August 12 · 9:00am - 11:30am http://www.facebook.com/event.php?eid=229646943743096 John Paul II College (JP2C) Saturday, August 13 · 9:00am - 4:00pm http://www.facebook.com/event.php?eid=220035684709122 University of Mindanao (UM) Wednesday, August 17 · 1:00pm - 5:00pm http://www.facebook.com/event.php?eid=245697658786703 University of Immaculate Conception (UIC) Saturday, August 20 · 1:00pm - 5:00pm http://www.facebook.com/event.php?eid=231713253532167 ACLC Monday, August 22 · 1:00pm - 4:00pm http://www.facebook.com/event.php?eid=231458190229578FuelPHP HMVC Framework August 2011www.silicongulf.com
  • August I.T. Events by PGO Holy Cross (HCDC) Tuesday, August 23 · 3:00pm - 6:00pm http://www.facebook.com/event.php?eid=253809011309471 InterCity College of Science and Technology (ICST) Wednesday, August 24 · 9:00pm - 11:00pm http://www.facebook.com/event.php?eid=225237414194879 AMA Computer College Thursday, August 25 · 9:30am - 1:00pm http://www.facebook.com/event.php?eid=138109472943706 STI College Friday, August 26 · 1:00am - 4:00pm http://www.facebook.com/event.php?eid=124462760983852FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Competition On-the-spot Student Web Design Competition August 27, 2011 http://www.facebook.com/event.php?eid=241281559236739 Entries can be found at http://www.silicongulf.com/competitions/web_designFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Our Loving Supporters • The SiliconGulf Initiative • Davao IT • Adobe User Group • PHP Philippines • Developers, Entrepreneurs, Artists of Davao • SEO-Philippines • The IT School with no name yet • Philippine Global OutsourcingFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Thanks To all speakers, PHP framework developers, our team at Philippine Global Outsourcing, students of all participating schools To the Adobe Development Team for this wonderful piece of software. Learn from the best www.silicongulf.comFuelPHP HMVC Framework August 2011www.silicongulf.com
  • Contact 2nd Floor Door #8 Andreliz Bldg #238 Araullo Extension 8000 Davao City Philippines philippineoutsourcing@gmail.com www.philippineglobaloutsourcing.com +63 916 477 9322 (globe) +63 907 775 6544 (smart) +63 922 551 4009 (sun) +63 923 725 4512 (sun) +63 82 224 1040 (landline)FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Copyright This reference material is exclusively distributed to the students of SiliconGulf Campus and should not be distributed, transmitted, or shared without the prior written consent of Christopher John Cubos http:// www.philippineglobaloutsourcing.com/chriscubos , SiliconGulf http://www.silicongulf.com/ or Philippines Outsourcing http://www.philippineglobaloutsourcing.com/ . This class material should be discussed by a trained instructor from SiliconGulf to maximize the learning and understanding of the topic. Others belong to their respective copyright holders. © Copyright 2011 SiliconGulf Campus and Christopher John Cubos. All Rights Reserved.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • Disclaimer • Course technology and the author specifically disclaim any and all other warranties, either express or implied, including warranties of merchantability, suitability to a particular task or purpose, or freedom from errors. • Some states do not allow for exclusion of implied warranties or limitation of incidental or consequential damages, so these limitations might not apply to you.FuelPHP HMVC Framework August 2011www.silicongulf.com
  • SiliconGulf Campus SiliconGulf Campus is one of the pioneers of game based learning system in the Philippines. Our goal is to combined complex theories with fun and excitement of playing games. SiliconGulf Campus 2nd Floor Door #8 Andreliz Bldg. #238 Araullo Extension 8000 Davao City Philippines silicongulfcampus@gmail.com www.silicongulf.com +63 916 477 9322 (globe) +63 907 775 6544 (smart) +63 922 551 4009 (sun) +63 923 725 4512 (sun) +63 82 224 1040 (landline)FuelPHP HMVC Framework August 2011www.silicongulf.com
  • FuelPHP HMVC Framework August 2011www.silicongulf.com