• Save
Code Igniter 2
Upcoming SlideShare
Loading in...5
×
 

Code Igniter 2

on

  • 1,601 views

 

Statistics

Views

Total Views
1,601
Views on SlideShare
1,539
Embed Views
62

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 62

http://www.n4express.com 62

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Code Igniter 2 Code Igniter 2 Presentation Transcript

  • Nitin Reddy Katkam
  • IntroductionCodeIgniter: Helps builds PHP applications based on the MVC structure Contains system and application folders; application folder contains models, views, and controllers folders
  • Configuration“application/config/database.php” “application/config/autoload.php”Set: $db[default][hostname] = localhost; $db[default][username] = username; $db[default][password] = password; $db[default][database] = dbname;
  • Controllers“application/controllers”Controllers: The default controller is welcome (defined in routes) The default action is index() Extend CI_Controller
  • Controllers (Contd)http://localhost/ci/index.php/product<?phpclass Product extends CI_Controller { public function index() { echo Product index; }}
  • Controllers (Contd) Call echo() to display data Put your data into an array Call $this->load->view() to display a view Load C.I. functions:  Alternative to autoload  $this->load->helper()  $this->load->library()
  • Views“application/views”Views: Data from the array sent from the controller is extracted
  • URL Helper anchor(„controller/action‟, „text‟, array(„att ribute‟=>‟value‟)) redirect(„controller/action‟)
  • Form Helper form_open(„controller/action‟) form_label(„text‟, „for attrib value‟) form_input(„name‟) form_password(„name‟) form_textarea(„name‟) form_submit(„name‟, „text‟) form_dropdown(„name‟, name- value_pair_array, „selected‟) form_close()
  • Models“application/models”Models: Extend CI_Model Generally uses the database library extensively
  • Database Library Generally called from a model class as $this->db->function_name Functions:  get(table_name, limit, offset)  insert(table_name, model)  insert_id()  where(column_name, value)  update(table_name, model)  delete(table_name)  count_all(table_name)
  • For more, reach me at... WWW: nitinkatkam.com Blog: n4express.com Email: k_nitin_r [at] yahoo.co.in