際際滷

際際滷Share a Scribd company logo
Introduction to CodeigniterHarishankaranInterviewstreet.com
WHY CI?Small.FastSimpleCleaner code
MVC
URL Structurehttp://example.com/controller_class/method/data<?phpclass Search extends CI_Controller  {[]	function retrieve($id) {	[]	$id2 = $this->uri->segment(3);	assert($id  = $id2);	[]	}}
CI  File structure
CI  Models<?phpclass User_Model extends CI_Model {[]	function getAllActiveUsers($id) {	[]	$this->db->from(users);	$this->db->where(active, true);	return $this->db->get()->result();	}}CRUD operations on database.
CI - Views<body><h1>Welcome to CodeIgniter!</h1><p>The page you are looking at is being generated dynamically by CodeIgniter.</p></body>HTML content, output to browser.
CI - Controllersclass Welcome extends CI_Controller {	function index()	{	$this->load->view('welcome_message');	}}Business Logic, Validations
CI  Twitter LibraryFetch public timeline<?php$this->load->library('twitter');$this->twitter->call('get', 'users/show', array('screen_name' => interviewstreet'));?>Search$this->twitter->search(array('q' => helloworld'));
CI  Askimet Library$this->load->library('akismet');$comment =array('comment_author' => Harishankaran','comment_author_email' => hari@interviewstreet.com','comment_content' => 'So, can you check if this comment is a spam.');$status = $this->akismet->check($comment);
And lots moreCalendarShopping cartEmailEncryptionFile UploadImage ManipulationPaginationXML-RPCand many many more 3rd party libraries
TALK IS CHEAP. SHOW ME THE CODE

More Related Content

Introduction to codeigniter