Model-View-Controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. Separation of concerns is one of the major reasons why MVC Frameworks were created. Learn more about it in our presentation. This presentation was done in more than 8 Universities, Colleges, and other training institutions in the Philippines by Christopher John Cubos. Comparison of PHP MVC Frameworks like Zend Framework, Symfony, CodeIgniter, Kohana, Yii Framework, and the latest PHP Framework - FuelPHP.
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
1. Intro to H/MVC Frameworks
CHRISTOPHER JOHN CUBOS
WEB DESIGN AND DEVELOPMENT MONTH (AUGUST 2011)
COLLEGES & UNIVERSITIES DAVAO CITY PHILIPPINES
PHP H/MVC Frameworks Aug 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 website competition in the Philippines
(1995)
• Developed his first CD-ROM application (1996)
• Developed his first flash site (1995)
… forward to the present
PHP H/MVC Frameworks Aug 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
PHP H/MVC Frameworks Aug 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.
PHP H/MVC Frameworks Aug 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
8. MVC Defined
• Model–view–controller (MVC) is a software
architecture, currently considered an
architectural pattern used in software
engineering. The pattern isolates "domain
logic" (the application logic for the user) from the
user interface (input and presentation),
permitting independent development, testing
and maintenance of each (separation of
concerns).
Source: wikipedia.org
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
9. How does MVC work?
Controller
View Model
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
10. History
• Not a new concept
• First described on 1979 MVC by Trygve
Reenskaug
• He was working on Smalltalk at Xerox PARC
• The original implementation is described in
depth in the influential paper "Applications
Programming in Smalltalk-80: How to use
Model–View–Controller"
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
11. The Model
• The model manages the behavior and data of the
application
• Responds to requests for information from both
the controller and view
• Business and data logic
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
12. The View
• Displays the content of the site.
• A view can be a template or an element of a site
• A model-view has a business logic inside it but
has design elements as well
• Translates raw data to readable user interface
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
13. The Controller
• The controller receives user input and initiates
a response by making calls on model objects.
• A controller accepts input from the user and
instructs the model and viewport to perform
actions based on that input.
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
14. Why use an MVC Framework
• Faster development time
• Use and reuse tested code
• Automation (ORM, Auth, generators)
• Maintainability
• Community driven
• Separation of code and design
• Agile development
• Modular development
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
16. Other PHP Frameworks
• Lithium – for people who hate frameworks
• Akelos – ported from ruby on rails
• Seagull – a mature OOP framework
• Lion – a dual MVC+MVP architecture
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
17.
18. Choosing PHP as a platform
• Easy to learn
• Easy to install in different operating systems
• The largest number developers
• More than 75% of websites run on PHP
• Open Source
• Powerful
• Tons of developer tools available
• Huge resources available
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
19. Detailed Framework Guide
A quick run through over top PHP frameworks
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
20. Zend Framework
• Open source (New BSD License)
• Object oriented
• MVC architecture
• PHP 5.2.4+
• Database Agnostic
• http://www.zendframework.com/
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
21. Zend Framework
• Provides a console tool for Rapid Development
• Generates models, controllers, layouts, & views
• Poor documentation
• No automated SQL generation
• No automated CRUD functions
• Default tutorials don’t provide basic
authentication and security related examples
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
22. CodeIgniter
• Not fully open source (CodeIgniter License)
• Object oriented
• MVC architecture
• PHP 5.1.6+
• Database Agnostic
– No native support for SQLite3
• http://codeigniter.com/
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
23. CodeIgniter
• No console tool
• No automated generation tool
• Very small footprint (2.2mb)
• Video tutorials only
• Tutorials and documentation (outdated)
• Default tutorials don’t provide basic
authentication and security related examples
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
24. Symfony
• Open source (MIT License)
• Object oriented
• MVC architecture
• PHP 5.2.4+
• Database Agnostic
– Uses doctrine or propel for Object Relational
Mapping (ORM) layer
• http://symfony.com/
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
25. Symfony
• Powerful console tool (symfony)
• Automagically generates all elements including
sql queries (from YAML source)
• Provides extremely detailed tutorials for all
functionality
• Tutorials work as documented
• The basic tutorial includes admin functionality as
well as authentication and security information
• Plugins are easy to install using console tool
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
26. CakePHP
• Open source (MIT License)
• Object oriented
• MVC architecture
• PHP4 (4.3.2+)
• Database Agnostic
– Does not natively support SQLite3
• http://cakephp.org/
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
27. CakePHP
• Console tool (cake)
• Cake bake generates code if a database is defined
including models, views, and controllers for the
tables in the database
• Cake schema is used for database backup/restore
functionality
• Separate tutorials for a weblog and ACL
controlled applications
• Tutorials work as documented
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
29. Yii Framework
• Powerful console tool (yiic)
• Does not generate SQL
• Uses Gii (web based code generator) for CRUD
operations
• Default Yii apps as generated by yiic includes
auth functionality and three basic pages
• Tutorials are regularly updated.
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
30. Kohana
• Open source (BSD License)
• Originally based on CodeIgniter, but no more
• Object oriented
• H/MVC architecture
• PHP 5.1.5
• Database Agnostic
– Does not natively support SQLite3
• http://kohanaframework.org/
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
31. Kohana
• No console tool
• No automated generation tool for any function
• Small footprint (1.1mb)
• Documentation is poor
• Tutorials and documentation poor
• Default tutorials don’t provide basic
authentication and security related examples
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
32. Kohana
• No console tool
• No automated generation tool for any function
• Small footprint (1.1mb)
• Documentation is poor
• Tutorials and documentation poor
• Default tutorials don’t provide basic
authentication and security related examples
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
33. FuelPHP
• Open source (MIT License)
• Based on ideas of multiple frameworks
• Object oriented
• H/MVC architecture
• PHP 5.3+
• Database Agnostic
• http://www.fuelphp.com
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
34. FuelPHP
• Powerful command line automation “OIL”
– Generate – Build MVC components, migrations, scaffolding
– Refine – run migration and custom functions
– Package – install and remove packages
– Console – Test your code in real time with an interactive shell
– Smallest footprint (865kb)
• New framework
• Tutorials and docs is sufficient but
• Default tutorials don’t provide basic authentication and
security related examples
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
35. How to you may choose
• You will be developing so choose the one that
suits your style and preferences
• Availability of Libraries
• Documentation and sample codes
• Available tools IDE, Automation, Testing
• Community activity
• Ease of hiring people who know the platform
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
36. How I choose a Framework
• Quality of code is very important
• Coding standards for a one-mind team
• Lightweight
• Performance
– Load what is needed
– Short travel for each execution of code
• Easy to create your own libraries
• Responsive community
• Flexibility to adapt to MY style
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
37.
38. What’s next
• Choose a framework
• Develop great applications
• Become a millionaire
• Party all day
• Share your knowledge
• Grow!!!
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
39. Thanks
Oops… There’s more
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
40. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
41. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
42. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
43. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
44. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
45. 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
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
48. 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.
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com
49. 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)
PHP H/MVC Frameworks Aug 2011
www.silicongulf.com