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

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,755
On Slideshare
1,693
From Embeds
62
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 62

http://www.n4express.com 62

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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