KEMBAR78
Introduction to MVC Web Framework with CodeIgniter | PPTX
INTRODUCTION TO MVC WEB
FRAMEWORK WITH CODEIGNITER
WHAT IS FRAMEWORK?
WHAT IS FRAMEWORK?
ï‚„ Provide general structure of the application
ï‚€ Therefore, you must learn its structure to be able
to use it
ï‚„ Handle common tasks
ï‚„ What is a difference between framework and
library?
ï‚€ Your code use library
ï‚€ Your code is used by framework
WHAT IS MVC?
WHAT IS MVC?
ï‚„ A Design Pattern
ï‚„ Stands for Model, View and Controller
ï‚„ Separate Business Logic from Presentation Logic
MODEL-VIEW-CONTROLLER
Model
ViewController
MODEL
ï‚„ Represents data
ï‚„ Hold data structure
ï‚„ Usually (but not always) backed by database
ï‚„ Contains data related logic
ï‚€ i.e. determine whether today is user birthday or
not
CONTROLLER
ï‚„ Holds business logic
ï‚„ Handling Input/Output
ï‚„ Notify model(s) of user action
ï‚„ Use view(s) for presentation
VIEW
ï‚„ How data will be displayed to user
ï‚„ Holds presentation logic
ï‚€ i.e. looping through a set of data to be displayed
MVC AND THE WEB
MVC FOR WEB
MVC WEB FRAMEWORK
Ruby
‱ Ruby on
Rails
‱ Merb
‱ Etc.
Python
‱ Django
‱ Pylons
‱ TurboGears
‱ Etc.
PHP
‱ CodeIgniter
‱ CakePHP
‱ Zend
Framework
‱ Etc.
INTRODUCTION TO CODEIGNITER
WHY CODEIGNITER?
Pros
ï‚„ Easy to learn and adopt
ï‚„ Easy to deploy
ï‚„ Lightweight
ï‚„ Extensive Thai user base
ï‚„ Thai document is available
ï‚€ http://codeigniter.in.th
by @Dominixz
Cons
ï‚„ It’s PHP :-(
ï‚„ Not very object-oriented in
some part
ï‚„ Incompetence cache and
view framework
ï‚€ Though you can plug
another toolset of your
choice instead
WANT A BETTER
EXPERIENCE?
A STANDARD BLOG EXAMPLE
WHAT DO WE NEED FOR A
BLOG?
COMPONENTS OF A BLOG
Post
(Entry)
(Static)
Page
Category
Comment Theme Tag
User Navigation Etc.
A (STUPIDLY) SIMPLE BLOG
ï‚„ Post
ï‚„ Comment
ï‚„ Front Page
ï‚„ Post Page
ï‚„ Create New Post Page
A (STUPIDLY) SIMPLE BLOG
BROKEN INTO MVC
Model
‱ Post
‱ Comment
Controller
‱ Blog
View
‱ Front
View
‱ Post View
‱ Create
New Post
View
WORKSHOP: CREATING A BLOG
WITH CODEIGNITER
CONCLUSION
CONCLUSION
ï‚„ What is a framework?
ï‚„ What is MVC?
ï‚€ Model – Represents data
ï‚€ Controller – Holds business logic
ï‚€ View – Holds presentation logic
ï‚„ MVC In Web Application
ï‚„ Implementing a blog with CodeIgniter
ANY QUESTION?
THANK YOU
REFERENCES
ï‚„ http://en.wikipedia.org/wiki/Model%E2%80%93
View%E2%80%93Controller
ï‚„ http://betterexplained.com/articles/intermediat
e-rails-understanding-models-views-and-
controllers/
ï‚„ http://slash7.com/2005/02/22/mvc-the-most-
vexing-conundrum/
CONTACT ME
ï‚„ Blog: http://aosekai.net
ï‚„ Email: knightbaron (at) gmail (dot) com
ï‚„ Twitter: @KnightBaron
ï‚„ Facebook: http://fb.me/knightbaron
ï‚„ IRC
ï‚€ #fanboi@irc.thai.com
ï‚€ #thai-fansubs@irc.thai.com

Introduction to MVC Web Framework with CodeIgniter

Editor's Notes

  • #4 A set of code that

  • #6 àč€àžŠàčˆàž™ Cookbook Bussiness Logic àžàč‡àžˆàž°àč€àž›àč‡àž™àžàžČàžŁàž•àžŽàž”àž•àčˆàž­ DB àč€àž­àžČàž•àžłàžŁàžČàž•àžČàžĄ Criteria àžĄàžČàč‚àžŠàž§àčŒ àžȘàčˆàž§àž™àžˆàž°àč‚àžŠàž§àčŒàžąàž±àž‡àč„àž‡àžàč‡ Presentation Logic
  • #7 àč„àžĄàčˆàčƒàžŠàčˆàžàžČàžŁàčàžąàž Layer àčàž•àčˆàč€àž›àč‡àž™ 3 Module àž—àž”àčˆàčàžąàžàž­àž­àžàžˆàžČàžàžàž±àž™
  • #14 CodeIgniter àžĄàž±àž™àžàč‡àž„àž·àž­ MVC Web Framework àž•àž±àž§àž™àž¶àž‡àž™àž±àčˆàž™àčàž«àž„àž° àčàž•àčˆàž—àžłàč„àžĄàž§àž±àž™àž™àž”àč‰àč€àžŁàžČàž–àž¶àž‡àč€àž„àž·àž­àž CodeIgniter?
  • #16Â àž­àčˆàž­! àč€àž”àž”àč‹àžąàž§àž—àž”àčˆ Lab Theory àžˆàž°àžĄàž” Workshop Django àž”àč‰àž§àžąàž™àž° àž§àž±àž™àž—àž”àčˆ 26-30 àčƒàž„àžŁàžȘàž™àčƒàžˆàž„àž‡àžŠàž·àčˆàž­àč„àž”àč‰
  • #18 àčàž•àčˆàčƒàž™àž§àž±àž™àž™àž”àč‰ àč€àžŁàžČàžˆàž°àčƒàžŠàč‰ CodeIgniter àč€àž‚àž”àžąàž™ Blog àž‡àčˆàžČàžąàč† àž‚àž­àž‡àč€àžŁàžČàč€àž­àž‡àž‚àž¶àč‰àž™àžĄàžČ