Guest User

Untitled

a guest
Jun 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2.  
  3. class Test extends Controller {
  4.  
  5. function Test()
  6. {
  7.  
  8. parent::Controller();
  9.  
  10. $this->load->scaffolding('entries');
  11. $this->load->helper('url');
  12. $this->load->helper('form');
  13. }
  14.  
  15. function index() {
  16.  
  17. $data['title'] = "What kind of tamale do you like?";
  18. $data['heading'] = "What kind of Tamale do you like?";
  19. $data['query'] = $this->db->get('entries');
  20.  
  21. $this->load->view('test_view' , $data);
  22. }
  23.  
  24. function comments() {
  25.  
  26. $data['title'] = "What kind of comment do you like?";
  27. $data['heading'] = "What kind of Comment do you like?";
  28. $this->db->where('entry_id', $this->uri->segment(3));
  29. $data['query'] = $this->db->get('comments');
  30.  
  31. $this->load->view('comment_view' , $data);
  32.  
  33.  
  34. }
  35.  
  36.  
  37. function comment_insert() {
  38.  
  39.  
  40. $this->db->insert('comments', $_POST);
  41. redirect('test/comments/'.$_POST['entry_id']);
  42.  
  43.  
  44. }
  45.  
  46. function new_post() {
  47.  
  48. $this->db->insert('entries', $_POST);
  49.  
  50. }
  51.  
  52.  
  53. }
  54.  
  55. ?>
Add Comment
Please, Sign In to add comment