Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Test extends Controller {
- function Test()
- {
- parent::Controller();
- $this->load->scaffolding('entries');
- $this->load->helper('url');
- $this->load->helper('form');
- }
- function index() {
- $data['title'] = "What kind of tamale do you like?";
- $data['heading'] = "What kind of Tamale do you like?";
- $data['query'] = $this->db->get('entries');
- $this->load->view('test_view' , $data);
- }
- function comments() {
- $data['title'] = "What kind of comment do you like?";
- $data['heading'] = "What kind of Comment do you like?";
- $this->db->where('entry_id', $this->uri->segment(3));
- $data['query'] = $this->db->get('comments');
- $this->load->view('comment_view' , $data);
- }
- function comment_insert() {
- $this->db->insert('comments', $_POST);
- redirect('test/comments/'.$_POST['entry_id']);
- }
- function new_post() {
- $this->db->insert('entries', $_POST);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment