E
dit
A
ttach
P
rintable
r5 - 28 May 2008 - 12:30:24 -
PattamaKrataithong
You are here:
SETEC Wiki
>
Knowledge Web
>
SoftwareEngineeringCategory
>
Agile
>
CodeigniterForCodingStandard
>
ApplicationFlowChart
Application Flow Chart ของ CodeIgniter
ไฟล์ index.php จะใช้กำหนดค่าเริ่มต้นของทรัพยากรพื้นฐานที่จำเป็นต้องใช้ในการ run CodeIgniter
Router จะตรวจสอบ HTTP request เพื่อพิจารณาว่าควรจะส่งข้อมูลให้หรือไม่
ถ้าเป็นไฟล์ที่เคยเรียกใช้งานแล้วจะเก็บไว้ในส่วนของ Caching แล้วจะส่งข้อมูลนั้นไปให้web browser โดยตรง
ก่อนทีจะโหลด controller จะมีการกรองข้อมูลผู้ใช้และตรวจสอบHTTP request ก่อนเพื่อความปลอดภัย
Controller จะโหลด model , libraries, plugins, helpers, และทรัพยากรอื่นๆ ที่จำเป็นในการร้องขอข้อมูลจาก server
หน้า view จะถูกแสดงเมื่อส่งข้อมูลไปยัง web browser ถ้าเป็นหน้า view ที่เคยเข้าไปแล้วไฟล์นั้นจะถูกเก็บไว้ในส่วน caching
ดังนั้นเมื่อมีการร้องขอไฟล์นี้ครั้งต่อไปก็สามารถส่งไปยัง web browserได้โดยตรง
Model-View-Controller
CodeIgniter มีรูปแบบการพัฒนาแบบ
MVC
(Model-View-Controller) ซึ่งเป็นการทำงานที่แยกส่วนที่ประมวลผลและส่วนที่แสดงผลออกจากกัน แสดงการทำงานดังรูปที่ 3.1
รูปที่3.1 การทำงานของ mvc
Model คลาสของ model จะประกอบด้วยฟังก์ชันที่เกี่ยวข้อง การเพิ่มและการเปลี่ยนแปลงข้อมูลในฐานข้อมูล
View เป็นส่วนของข้อมูลที่ใช้แสดงผล ซึ่งในส่วนของ viewจะสามารถแบ่งเว็บเพจเป็นส่วนย่อยได้ เช่น header , footer เป็นต้น
Controller คลาสของ controller เป็นส่วนที่อยู่ตรงกลาง เชื่อมต่อระหว่าง model , view และทรัพยากรอื่นๆที่จำเป็นในกระบวนการ HTTP request และ การแสดงหน้าเว็บ
BACK
Show attachments
Hide attachments
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
JPG
pic1.1.JPG
manage
18.1 K
27 May 2008 - 23:12
PattamaKrataithong
png
mvc-rails.png
manage
11.7 K
28 May 2008 - 00:42
PattamaKrataithong
E
dit
|
A
ttach
|
P
rintable
|
R
aw View
|
Backlinks:
We
b
,
A
l
l Webs
|
H
istory
: r5
<
r4
<
r3
<
r2
<
r1
|
M
ore topic actions
Knowledge
Log In
or
Register
Reset Password
Knowledge Web
Create New Topic
Topic List
Search
Changes
Notifications
Statistics
Rss
,
Atom
External Webs
Knowledge
Products
Pub
Internal Webs
Management
Projects
CMMI
Kampong School
Main
TWiki
Trash
Reset Password
Copyright ©2012 by National Electronics and Computer Technology Center, NECTEC.
Ideas, requests, problems regarding SETEC Wiki?
Send feedback