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.
Potential of AI (Generative AI) in Business: Learnings and Insights
FuelPHP - a PHP HMVC Framework by silicongulf.com
1. FuelPHP
CHRISTOPHER JOHN CUBOS
WEB DESIGN AND DEVELOPMENT MONTH (AUGUST 2011)
COLLEGES & UNIVERSITIES DAVAO CITY PHILIPPINES
FuelPHP HMVC Framework August 2011
www.silicongulf.com
2.
3. 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 present
FuelPHP HMVC Framework August 2011
www.silicongulf.com
5. 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 design
FuelPHP HMVC Framework August 2011
www.silicongulf.com
6. 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 Mindanao
FuelPHP HMVC Framework August 2011
www.silicongulf.com
7. Brewing
• We are currently developing the first game-based
training center in Mindanao
• Multiple mobile apps and games
• Organizing multiple upcoming I.T. events
FuelPHP HMVC Framework August 2011
www.silicongulf.com
8. 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 2011
www.silicongulf.com
9. 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 automagic
FuelPHP HMVC Framework August 2011
www.silicongulf.com
10. 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 style
FuelPHP HMVC Framework August 2011
www.silicongulf.com
12. 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 XAMPP
FuelPHP HMVC Framework August 2011
www.silicongulf.com
13. Installing: Windows
• Install WAMP or XAMPP
• Download Fuel PHP
• Run!
FuelPHP HMVC Framework August 2011
www.silicongulf.com
16. 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 logic
FuelPHP HMVC Framework August 2011
www.silicongulf.com
17. How does MVC work?
Controller
View Model
FuelPHP HMVC Framework August 2011
www.silicongulf.com
18. Controllers
• Fuel's 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 2011
www.silicongulf.com
19. 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 won't need to
change all your Controllers, just the Model.
FuelPHP HMVC Framework August 2011
www.silicongulf.com
20. 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 2011
www.silicongulf.com
21. ViewModels
• When your application gets more complex you'll
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 2011
www.silicongulf.com
22. 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 2011
www.silicongulf.com
24. 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 2011
www.silicongulf.com
25. 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 OIL
FuelPHP HMVC Framework August 2011
www.silicongulf.com
28. 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 2011
www.silicongulf.com
30. Showcase: What we’ve done.
• DEMO: Social networking site using
• DEMO: Game-based learning system
• DEMO: Photo Gallery
• DEMO: Basic user authentication
FuelPHP HMVC Framework August 2011
www.silicongulf.com
33. 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 2011
www.silicongulf.com
34. What’s next
• Try something in OIL
• Modify it
• Read docs
• Create some apps
• Repeat and master
• Join forums
• Search the net
FuelPHP HMVC Framework August 2011
www.silicongulf.com
35. Thanks
Oops… There’s more
FuelPHP HMVC Framework August 2011
www.silicongulf.com
36. 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 Month
FuelPHP HMVC Framework August 2011
www.silicongulf.com
37. 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=231458190229578
FuelPHP HMVC Framework August 2011
www.silicongulf.com
38. 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=124462760983852
FuelPHP HMVC Framework August 2011
www.silicongulf.com
39. 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_design
FuelPHP HMVC Framework August 2011
www.silicongulf.com
40. 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 Outsourcing
FuelPHP HMVC Framework August 2011
www.silicongulf.com
41. 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.com
FuelPHP HMVC Framework August 2011
www.silicongulf.com
44. 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 2011
www.silicongulf.com
45. 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 2011
www.silicongulf.com