Date post: | 16-May-2015 |
Category: |
Technology |
Upload: | christopher-cubos |
View: | 16,410 times |
Download: | 2 times |
FuelPHPCHRISTOPHER JOHN CUBOS
WEB 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 present
FuelPHP HMVC Framework August 2011 www.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 2011 www.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 design
FuelPHP HMVC Framework August 2011 www.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 Mindanao
FuelPHP HMVC Framework August 2011 www.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. events
FuelPHP HMVC Framework August 2011 www.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 2011 www.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 automagic
FuelPHP HMVC Framework August 2011 www.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 style
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Getting Started: Downloadwww.fuelphp.com
• Framework• Documentation• Packages
– Oil– Auth– ORM
FuelPHP HMVC Framework August 2011 www.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 XAMPP
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Installing: Windows• Install WAMP or XAMPP• Download Fuel PHP• Run!
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Recommended Tools• Adobe Dreamweaver• CodeLobster• E-texteditor• Komodo• Eclipse• Google Chrome• WAMP• Notepad++• Navicat
FuelPHP HMVC Framework August 2011 www.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 logic
FuelPHP HMVC Framework August 2011 www.silicongulf.com
How does MVC work?
View Model
Controller
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Controllers• Fuel's routing decides based on the
requested URL what controller toload and what method to call upon it.
• The Controller decides what actions to take, what to do with any user input, what data getsmanipulated 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
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
Views• Views contain your HTML, which should never
be found in your Controllers or any other classthat 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
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
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
Let’s Code .. Not!!!Excited, hehe
FuelPHP HMVC Framework August 2011 www.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 2011 www.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 OIL
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Creating Tables and CRUD> php oil g scaffold users username:varchar
password:varchar sex:tinyint
Creating model: C:\wamp\www\fuelphp\fuel\app\classes/model/users.phpCreating migration: C:\wamp\www\fuelphp\fuel\app\migrations/001_create_users.phpCreating controller: C:\wamp\www\fuelphp\fuel\app\classes/controller/users.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/users/index.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/users/view.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/users/create.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/users/edit.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/users/_form.phpCreating view: C:\wamp\www\fuelphp\fuel\app\views/template.php
> php oil refine migrate:up
FuelPHP HMVC Framework August 2011 www.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 2011 www.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 2011 www.silicongulf.com
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
Social Network (development)
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Photo Gallery (under development)
FuelPHP HMVC Framework August 2011 www.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 2011 www.silicongulf.com
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
ThanksOops… There’s more
FuelPHP HMVC Framework August 2011 www.silicongulf.com
Full year of IT EventsAugust 2011: Web Development MonthSeptember 2011: Mobile Application MonthOctober 2011: Animation MonthNovember 2011: Bloggers MonthDecember 2011: SEO MonthJanuary 2012: Technopreneurship MonthFebruary 2012: I.T. Education MonthMarch 2012: I.T. Career MonthApril 2012: Gaming MonthMay 2012: Graphic Design MonthJune 2012: Hacking and Network Security MonthJuly 2012: Software Development Month
FuelPHP HMVC Framework August 2011 www.silicongulf.com
August I.T. Events by PGOUniversity of Southeastern Philippines (USEP)Friday, August 12 · 9:00am - 11:30amhttp://www.facebook.com/event.php?eid=229646943743096 John Paul II College (JP2C)Saturday, August 13 · 9:00am - 4:00pmhttp://www.facebook.com/event.php?eid=220035684709122 University of Mindanao (UM)Wednesday, August 17 · 1:00pm - 5:00pmhttp://www.facebook.com/event.php?eid=245697658786703 University of Immaculate Conception (UIC)Saturday, August 20 · 1:00pm - 5:00pmhttp://www.facebook.com/event.php?eid=231713253532167
ACLCMonday, August 22 · 1:00pm - 4:00pmhttp://www.facebook.com/event.php?eid=231458190229578
FuelPHP HMVC Framework August 2011 www.silicongulf.com
August I.T. Events by PGOHoly Cross (HCDC)Tuesday, August 23 · 3:00pm - 6:00pmhttp://www.facebook.com/event.php?eid=253809011309471 InterCity College of Science and Technology (ICST)Wednesday, August 24 · 9:00pm - 11:00pmhttp://www.facebook.com/event.php?eid=225237414194879
AMA Computer CollegeThursday, August 25 · 9:30am - 1:00pmhttp://www.facebook.com/event.php?eid=138109472943706
STI CollegeFriday, August 26 · 1:00am - 4:00pmhttp://www.facebook.com/event.php?eid=124462760983852
FuelPHP HMVC Framework August 2011 www.silicongulf.com
CompetitionOn-the-spot Student Web Design CompetitionAugust 27, 2011http://www.facebook.com/event.php?eid=241281559236739
Entries can be found athttp://www.silicongulf.com/competitions/web_design
FuelPHP HMVC Framework August 2011 www.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 Outsourcing
FuelPHP HMVC Framework August 2011 www.silicongulf.com
ThanksTo 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
Contact2nd Floor Door #8 Andreliz Bldg#238 Araullo Extension8000 Davao City Philippinesphilippineoutsourcing@gmail.comwww.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 2011 www.silicongulf.com
CopyrightThis 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 PhilippinesOutsourcing 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 2011 www.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 2011 www.silicongulf.com
SiliconGulf CampusSiliconGulf 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 Campus2nd Floor Door #8 Andreliz Bldg.#238 Araullo Extension8000 Davao City [email protected]+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
FuelPHP HMVC Framework August 2011 www.silicongulf.com