Nitin Reddy Katkam
IntroductionCodeIgniter: Helps builds PHP applications based on  the MVC structure Contains system and application folde...
Configuration“application/config/database.php”   “application/config/autoload.php”Set: $db[default][hostname] = localhost...
Controllers“application/controllers”Controllers: The default controller is welcome  (defined in routes) The default acti...
Controllers (Contd)http://localhost/ci/index.php/product<?phpclass Product extends CI_Controller {   public function index...
Controllers (Contd) Call echo() to display data Put your data into an array Call $this->load->view() to display a  view...
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_pass...
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,...
For more, reach me at... WWW: nitinkatkam.com Blog: n4express.com Email: k_nitin_r [at] yahoo.co.in
Upcoming SlideShare
Loading in...5
×

Code Igniter 2

1,333

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,333
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Code Igniter 2

  1. 1. Nitin Reddy Katkam
  2. 2. IntroductionCodeIgniter: Helps builds PHP applications based on the MVC structure Contains system and application folders; application folder contains models, views, and controllers folders
  3. 3. 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;
  4. 4. Controllers“application/controllers”Controllers: The default controller is welcome (defined in routes) The default action is index() Extend CI_Controller
  5. 5. Controllers (Contd)http://localhost/ci/index.php/product<?phpclass Product extends CI_Controller { public function index() { echo Product index; }}
  6. 6. 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()
  7. 7. Views“application/views”Views: Data from the array sent from the controller is extracted
  8. 8. URL Helper anchor(„controller/action‟, „text‟, array(„att ribute‟=>‟value‟)) redirect(„controller/action‟)
  9. 9. 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()
  10. 10. Models“application/models”Models: Extend CI_Model Generally uses the database library extensively
  11. 11. 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)
  12. 12. For more, reach me at... WWW: nitinkatkam.com Blog: n4express.com Email: k_nitin_r [at] yahoo.co.in

×