8/2/2019 Toby Beresford Ci Overview
1/36
CodeIgniter PHP
Framework
Toby Beresford
8/2/2019 Toby Beresford Ci Overview
2/36
Content
Bio
Benefits
Why Frameworks MVC
Demo
Links
8/2/2019 Toby Beresford Ci Overview
3/36
Toby Bio
12 years professional Web App Development 5 years - Lotus Domino 7 years - PHP
Toby Beresford Applications Ltd
Platform applications Facebook Bebo, Myspace et al.
Clients Sky News, Last.fm, Comic Relief, VideoJug, AfffiliateWindow,
.name registry.
hwww.facebook.com/pages/Toby-Beresford-Applications/6164004474
mailto:[email protected]://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474mailto:[email protected]8/2/2019 Toby Beresford Ci Overview
4/36
Benefits of CI
Small
Fast
Simple
Customer ready a sys admin can install the CI framework in a few minutes great documentation means easy hand over: new developers
just learn the framework not your home grown MVC code
Great for mash-up apps using multiple platforms eg. Facebook apps
Cleaner code
http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/61640044748/2/2019 Toby Beresford Ci Overview
5/36
Why FrameworksNo framework
Framework
Me and my framework
Framework
Platform API
Me, my framework and
a Platform API
http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/61640044748/2/2019 Toby Beresford Ci Overview
6/36
MVCView (views/frog_count.php)
Youve items in list
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);
}Model (models/frogs.php)function count_frogs() {
$this->db->where(type,frog);$this->db->from(animals);
$query = $this->db->get();Return $query->num_rows();
Model
View
Controller
http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/61640044748/2/2019 Toby Beresford Ci Overview
7/36
How to run a CI method
http://www.my_server.com/index.php/my_controller/my_frog
Where youve installed CI
Your main controller file:System/application/controllers/my_controller.php
The name of a method in your controller
http://www.facebook.com/pages/Toby-Beresford-Applications/6164004474http://www.facebook.com/pages/Toby-Beresford-Applications/61640044748/2/2019 Toby Beresford Ci Overview
8/36
Download fromwww.codeigniter.com
8/2/2019 Toby Beresford Ci Overview
9/36
Upload to your server
8/2/2019 Toby Beresford Ci Overview
10/36
See the welcome screen
8/2/2019 Toby Beresford Ci Overview
11/36
Create your database
8/2/2019 Toby Beresford Ci Overview
12/36
Configure CodeIgniter BaseURL
8/2/2019 Toby Beresford Ci Overview
13/36
Configure DatabaseConnection
8/2/2019 Toby Beresford Ci Overview
14/36
Create a controller
8/2/2019 Toby Beresford Ci Overview
15/36
Add the view
8/2/2019 Toby Beresford Ci Overview
16/36
Try it
8/2/2019 Toby Beresford Ci Overview
17/36
Send variables to the view viaan array
VIEW
CONTROLLER
8/2/2019 Toby Beresford Ci Overview
18/36
And
8/2/2019 Toby Beresford Ci Overview
19/36
Model: Get item
Uses ActiveRecord
8/2/2019 Toby Beresford Ci Overview
20/36
Model: Put Item
8/2/2019 Toby Beresford Ci Overview
21/36
Model: Get all
8/2/2019 Toby Beresford Ci Overview
22/36
Model: Delete Item
8/2/2019 Toby Beresford Ci Overview
23/36
Controller: Add
8/2/2019 Toby Beresford Ci Overview
24/36
View: Add/Edit
8/2/2019 Toby Beresford Ci Overview
25/36
User Interface: Add
8/2/2019 Toby Beresford Ci Overview
26/36
Controller: Save
8/2/2019 Toby Beresford Ci Overview
27/36
Controller: Edit
8/2/2019 Toby Beresford Ci Overview
28/36
User Interface: Edit
8/2/2019 Toby Beresford Ci Overview
29/36
Controller: List all
8/2/2019 Toby Beresford Ci Overview
30/36
Views: List
Note we can use ordinary PHP in the views, no templatelanguage to learn
8/2/2019 Toby Beresford Ci Overview
31/36
User Interface: List
8/2/2019 Toby Beresford Ci Overview
32/36
Controller: Delete
8/2/2019 Toby Beresford Ci Overview
33/36
Views: Delete Confirm
8/2/2019 Toby Beresford Ci Overview
34/36
User Interface: Delete
8/2/2019 Toby Beresford Ci Overview
35/36
Summary
CI is fast to run, light to deploy andeasy to learn
Great for mash-up applications in theplatform world
Wishlist = Eg. AffiliateWindow retailerlist API, product API, Facebook UI,
Facebook User tables, + PayPal masspay for commissions
8/2/2019 Toby Beresford Ci Overview
36/36
Useful links www.codeigniter.com
User manual, community forums,releases
www.kohanaphp.com PHP5 CodeIgniter fork
www.phpframeworks.info All the frameworks side by side
www.people4web2.com Search engine optimised contractor
site with a skills category for themajor PHP Frameworks
LondonGarage06.eventbrite.com Facebook Developer Garage 5th
March
Q ti ?
http://www.codeigniter.com/http://www.kohanaphp.com/http://www.phpframeworks.info/http://www.people4web2.com/http://londongarage06.eventbrite.com/http://londongarage06.eventbrite.com/http://www.people4web2.com/http://www.phpframeworks.info/http://www.kohanaphp.com/http://www.codeigniter.com/