![Page 1: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/1.jpg)
CodeIgniterIntroduction to
20 May 2009
![Page 2: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/2.jpg)
What is CodeIgniter?
Open Source PHP Framework
<?php $this->load->view(‘about’);
![Page 3: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/3.jpg)
What is CodeIgniter?
Open Source PHP Framework Free (as in beer / as in rights)
<?php $this->load->view(‘about’);
![Page 4: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/4.jpg)
What is CodeIgniter?
Open Source PHP Framework Free (as in beer / as in rights) The “guts” of ExpressionEngine 2
<?php $this->load->view(‘about’);
![Page 5: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/5.jpg)
What is CodeIgniter?
Open Source PHP Framework Free (as in beer / as in rights) The “guts” of ExpressionEngine 2 Backed by bootstrapped company
<?php $this->load->view(‘about’);
![Page 6: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/6.jpg)
History of CodeIgniter
‘01: Rick Ellis develops pMachine
<?php $this->load->model(‘event’); $data[‘events’] = $this->event->get_all(); $this->load->view(‘history’, $data);
![Page 7: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/7.jpg)
History of CodeIgniter
‘01: Rick Ellis develops pMachine ‘02: pMachine publicly released
<?php $this->load->model(‘event’); $data[‘events’] = $this->event->get_all(); $this->load->view(‘history’, $data);
![Page 8: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/8.jpg)
History of CodeIgniter
‘01: Rick Ellis develops pMachine ‘02: pMachine publicly released ‘04: ExpressionEngine released
<?php $this->load->model(‘event’); $data[‘events’] = $this->event->get_all(); $this->load->view(‘history’, $data);
![Page 9: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/9.jpg)
History of CodeIgniter
‘01: Rick Ellis develops pMachine ‘02: pMachine publicly released ‘04: ExpressionEngine released ‘06: CodeIgniter released
<?php $this->load->model(‘event’); $data[‘events’] = $this->event->get_all(); $this->load->view(‘history’, $data);
![Page 10: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/10.jpg)
History of CodeIgniter
‘01: Rick Ellis develops pMachine ‘02: pMachine publicly released ‘04: ExpressionEngine released ‘06: CodeIgniter released ’08: ExpressionEngine 2 demoed at SXSW
<?php $this->load->model(‘event’); $data[‘events’] = $this->event->get_all(); $this->load->view(‘history’, $data);
![Page 11: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/11.jpg)
CodeIgniter Key Features
Small footprint
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
2.9x
10.5x
![Page 12: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/12.jpg)
CodeIgniter Key Features
Small footprint PHP 4 compatible
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
![Page 13: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/13.jpg)
CodeIgniter Key Features
Small footprint PHP 4 compatible Database abstraction layer
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
![Page 14: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/14.jpg)
CodeIgniter Key Features
Small footprint PHP 4 compatible Database abstraction layer Global XSS filtering
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
![Page 15: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/15.jpg)
CodeIgniter Key Features
Small footprint PHP 4 compatible Database abstraction layer Global XSS filtering SEO friendly URLs
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
example.com/controller/method/var1/var2
![Page 16: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/16.jpg)
CodeIgniter Key Features
Small footprint PHP 4 compatible Database abstraction layer Global XSS filtering SEO friendly URLs Infinitely extensible
<?php $this->load->model(‘feature’); $data[‘features’] = $this->feature->get_all(); $this->load->view(‘features’, $data);
![Page 17: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/17.jpg)
“I found CodeIgniter the lightest framework out there and it doesn’t impose too many restrictions.”
Rasmus LerdorfCreator of PHPInfrastructure Architect, Yahoo
![Page 18: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/18.jpg)
Model (models/post.php)
<?phpclass Post extends Model { function Post() { parent::Model(); }
function get_all() { $this->db->order_by(‘postdate’, ‘DESC’); $query = $this->db->get(‘posts’, 10, 0); if ($query->num_rows() > 0) { return $query->result(); } return FALSE; }}
![Page 19: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/19.jpg)
Model (models/post.php)
<?phpclass Post extends Model { function Post() { parent::Model(); }
function get_all() { $this->db->order_by(‘postdate’, ‘DESC’); $query = $this->db->get(‘posts’, 10, 0); if ($query->num_rows() > 0) { return $query->result(); } return FALSE; }}
![Page 20: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/20.jpg)
Model (models/post.php)
<?phpclass Post extends Model { function Post() { parent::Model(); }
function get_all() { $this->db->order_by(‘postdate’, ‘DESC’); $query = $this->db->get(‘posts’, 10, 0); if ($query->num_rows() > 0) { return $query->result(); } return FALSE; }}
![Page 21: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/21.jpg)
Controller (controllers/posts.php)
<?phpclass Posts extends Controller { function Posts() { parent::Controller(); }
function index() { $this->load->model(‘post’); $data[‘posts’] = $this->post->get_all(); $this->load->view(‘home’, $data); }}
![Page 22: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/22.jpg)
Controller (controllers/posts.php)
<?phpclass Posts extends Controller { function Posts() { parent::Controller(); }
function index() { $this->load->model(‘post’); $data[‘posts’] = $this->post->get_all(); $this->load->view(‘home’, $data); }}
![Page 23: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/23.jpg)
Controller (controllers/posts.php)
<?phpclass Posts extends Controller { function Posts() { parent::Controller(); }
function index() { $this->load->model(‘post’); $data[‘posts’] = $this->post->get_all(); $this->load->view(‘home’, $data); }}
![Page 24: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/24.jpg)
View (views/home.php)
<!-– html, head, body tag --><?php foreach($posts as $p): ?> <div class=“post”> <h2><?php echo $p->title; ?></h2> <div class=“excerpt”> <?php echo $p->excerpt; ?> </div> <p><?php echo anchor($p->id, ‘Read More’); ?
></p> </div><?php endforeach; ?><!-- /body, /head, /html tags -->
![Page 25: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/25.jpg)
View (views/home.php)
<!-– html, head, body tag --><?php foreach($posts as $p): ?> <div class=“post”> <h2><?php echo $p->title; ?></h2> <div class=“excerpt”> <?php echo $p->excerpt; ?> </div> <p><?php echo anchor($p->id, ‘Read More’); ?
></p> </div><?php endforeach; ?><!-- /body, /head, /html tags -->
![Page 26: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/26.jpg)
View (views/home.php)
<!-– html, head, body tag --><?php foreach($posts as $p): ?> <div class=“post”> <h2><?php echo $p->title; ?></h2> <div class=“excerpt”> <?php echo $p->excerpt; ?> </div> <p><?php echo anchor($p->id, ‘Read More’); ?
></p> </div><?php endforeach; ?><!-- /body, /head, /html tags -->
![Page 27: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/27.jpg)
View (views/home.php)
<!-– html, head, body tag --><?php foreach($posts as $p): ?> <div class=“post”> <h2><?php echo $p->title; ?></h2> <div class=“excerpt”> <?php echo $p->excerpt; ?> </div> <p><?php echo anchor($p->id, ‘Read More’); ?
></p> </div><?php endforeach; ?><!-- /body, /head, /html tags -->
![Page 28: Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)](https://reader036.vdocument.in/reader036/viewer/2022062514/5590345b1a28ab082d8b4658/html5/thumbnails/28.jpg)
View (views/home.php)
<!-– html, head, body tag --><?php foreach($posts as $p): ?> <div class=“post”> <h2><?php echo $p->title; ?></h2> <div class=“excerpt”> <?php echo $p->excerpt; ?> </div> <p><?php echo anchor($p->slug, ‘Read More’); ?
></p> </div><?php endforeach; ?><!-- /body, /head, /html tags -->
example.com/refreshaugust-may-2009