Basic Code Igniter Controller pt. 2


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. class Blog extends Controller {
  3.  
  4. function index()
  5. {
  6. $this->load->model('Blog');
  7. $data['query'] = $this->Blog->get_last_ten_entries();
  8. $this->load->view('blogview', $dog);
  9. }
  10. function comments($id, $name)
  11. {
  12. echo "your id is: " . $id;
  13. echo "your name is: " . $name;
  14. }
  15.  
  16. }
  17. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.