Codeigniter Loves You
Codeigniter Loves You
Who is EllisLab?
CodeIgniter ExpressionEngine ExpressionHosting
CodeIgniter
CodeIgniter is an Application Development Framework a toolkit - for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.
Source: CodeIgniter.com Manual
What is CodeIgniter?
(a framework, duh)
What is CodeIgniter?
(a framework, duh)
Simplicity is king
What is CodeIgniter?
(a framework, duh)
What is CodeIgniter?
(a framework, duh)
What is CodeIgniter?
(a framework, duh)
Simplicity is king A real framework (not like those Zenders) Tiny Light
What is CodeIgniter?
(a framework, duh)
Simplicity is king A real framework (not like those Zenders) Tiny Light ...and, oh yeah, simple
Zend Framework above is minimal install, the others huge. Prados just as bad...
Wednesday, January 13, 2010
Naming Conventions
Controllers
In the le: /system/application/controllers/blog.php
<?php class Blog extends Controller { function Blog(){ parent::Controller(); } function index($id){ //Im called by default! //$id is from URL - /site/blog/1 } } ?>
Naming Conventions
Models
In the le: /system/application/models/blog_model.php
<?php class Blog_model extends Model { function Blog_model(){ parent::Model(); } function getBlogEntries($id){ $this->db->get_where(blog,array(ID=>$id)); } } ?>
Naming Conventions
Libraries
In the le: /system/application/libraries/Defensio.php
<?php class Defensio { private $_conn = null; function Defensio(){ } function checkSpam($data){ $this->_conn->open(); } } ?>
Naming Conventions
Helpers
In the le: /system/application/helpers/blog_helper.php
Setting Up
Setting Up
Almost no conguration
Setting Up
Almost no conguration PHP4 Support
Setting Up
Almost no conguration PHP4 Support No default templating
Setting Up
Almost no conguration PHP4 Support No default templating Bundled Libraries
Conguration
Make changes to the cong.php le
hostname
Community
Community
Great documentation (included)
Community
Great documentation (included) Active forums
Community
Great documentation (included) Active forums IRC channel (Freenode)
Community
Great documentation (included) Active forums IRC channel (Freenode) User support
Community
Great documentation (included) Active forums IRC channel (Freenode) User support Community Wiki
Library Spotlight:
Form/Validation
Form Helper
Easily create forms - just echo Simple interface for simple or detailed cong The usual suspects
Validation Library
Set up rules and elds Rules include: required, alpha_numeric, valid_email, valid_ip Callbacks
Library Spotlight:
Form/Validation
<?php class Blog extends Controller { function Blog(){ parent::Controller(); } function index($id){ $this->load->library(validation); $rules=array( title=>required ); $fields=array( title=>Title ); $this->validation->set_fields($fields); $this->validation->set_rules($rules); if($this->validation->run()!=FALSE){ echo success!; } } ?> }
Library Spotlight:
Loader
Included by default Methods for major types:
$this->load->model(my_model); $this->load->library(mylib); $this->load->view(myview);
Library Spotlight:
Input/Security
XSS ltering Security ltering
GET all globals lters POST/COOKIE on array key Only \n for newlines
Library Spotlight:
Doctrine Integration
Make changes to the database.php le
create DSN set up paths and autoloader create the Doctrine connection make command line interface make Doctrine directories (xtures, migrations, etc.)
All standard commands available with CLI Extend Doctrine_Record & Doctrine_Table
Wednesday, January 13, 2010
Credits/Contact
Chris Cornutt
[email protected]