introduction to codeigniter

27
Introduction to CodeIgniter PHP Framework

Upload: piti-suwannakom

Post on 06-May-2015

566 views

Category:

Technology


6 download

DESCRIPTION

Introduction to CodeIgniter PHP Framework

TRANSCRIPT

Page 1: Introduction to CodeIgniter

Introduction to CodeIgniter

PHP Framework

Page 2: Introduction to CodeIgniter

“I am PHP developer”

Page 3: Introduction to CodeIgniter

Why PHP?

Page 4: Introduction to CodeIgniter

Why PHP?

Crossable Platform Free  Fast Flexible

Page 5: Introduction to CodeIgniter

Trends

Page 6: Introduction to CodeIgniter

PHP Framework?

Page 7: Introduction to CodeIgniter

PHP Framework

Zend Framework CodeIgniter Symfony CakePHP Yii Laravel

Page 8: Introduction to CodeIgniter

How to choose?

Features Maturity Communities Sponsor Trends

Page 9: Introduction to CodeIgniter

Codeingiter

Features Maturity Communities Sponsor Trends

Page 10: Introduction to CodeIgniter

Features

Small footprint & Light weight.Clear, thorough documentation.Nearly zero configuration. Use MVC Framework

Page 11: Introduction to CodeIgniter

Maturity

Page 12: Introduction to CodeIgniter

Support / Communities

Wiki https://github.com/EllisLab/CodeIgniter/w

iki Forums

http://ellislab.com/forums Thailand

http://codeigniter.in.th/

Page 13: Introduction to CodeIgniter

Sponsor

Page 14: Introduction to CodeIgniter

Trends

Page 15: Introduction to CodeIgniter

MVC Framework

Model

ViewController

Page 16: Introduction to CodeIgniter

How to use MVC ?

Page 17: Introduction to CodeIgniter

Application Flow Chart

Page 18: Introduction to CodeIgniter

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

Page 19: Introduction to CodeIgniter

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();

}

Page 20: Introduction to CodeIgniter

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);

}

Page 21: Introduction to CodeIgniter

MVC - View

View (views/frog_count.php) <html>▪ <body>▪ <h1> You’ve <?=$froggies;?> items in list</h1>

▪ </body> </html>

Page 22: Introduction to CodeIgniter

Review Quiz

Page 23: Introduction to CodeIgniter

Reference

http://www.php.net http://en.wikipedia.org/wiki/PHP http://www.phpframeworks.com http://ellislab.com/codeigniter http://codeigniter.in.th

Page 24: Introduction to CodeIgniter

Course Feedback Form

Page 25: Introduction to CodeIgniter

Instructor Evaluation Form

Page 26: Introduction to CodeIgniter

Question ?

Page 27: Introduction to CodeIgniter

Thank You