Upload
piti-suwannakom
View
566
Download
6
Embed Size (px)
DESCRIPTION
Introduction to CodeIgniter PHP Framework
Citation preview
Introduction to CodeIgniter
PHP Framework
“I am PHP developer”
Why PHP?
Why PHP?
Crossable Platform Free Fast Flexible
Trends
PHP Framework?
PHP Framework
Zend Framework CodeIgniter Symfony CakePHP Yii Laravel
How to choose?
Features Maturity Communities Sponsor Trends
Codeingiter
Features Maturity Communities Sponsor Trends
Features
Small footprint & Light weight.Clear, thorough documentation.Nearly zero configuration. Use MVC Framework
Maturity
Support / Communities
Wiki https://github.com/EllisLab/CodeIgniter/w
iki Forums
http://ellislab.com/forums Thailand
http://codeigniter.in.th/
Sponsor
Trends
MVC Framework
Model
ViewController
How to use MVC ?
Application Flow Chart
Example
http://www.my_server.com/index.php/my_controller/my_frogs
Where you’ve installed CI
Your main controller file:System/application/controllers/my_controller.php
The name of a method in your controller
MVC - Model
Model (models/frogs.php) function count_frogs() {▪ $this->db->where(“type”, ”frog”);▪ $this->db->from(“animals”);▪ $query = $this->db->get();▪ return $query->num_rows();
}
MVC - Controller
Controller (controllers/my_controller.php) function total_frogs () {▪ $this->load->model(“frogs”);▪ $number_of_frogs = $this->frogs->count_frogs();▪ $data[‘froggies’] = $number_of_frogs;▪ $this->load->view(“frog_view”, $data);
}
MVC - View
View (views/frog_count.php) <html>▪ <body>▪ <h1> You’ve <?=$froggies;?> items in list</h1>
▪ </body> </html>
Review Quiz
Reference
http://www.php.net http://en.wikipedia.org/wiki/PHP http://www.phpframeworks.com http://ellislab.com/codeigniter http://codeigniter.in.th
Course Feedback Form
Instructor Evaluation Form
Question ?
Thank You