public
Created

  • Download Gist
ci day 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
function create(){
$this->form_validation->set_rules('title', 'Title', 'trim|required');
$this->form_validation->set_rules('content', 'Content', 'trim|required');
if($this->form_validation->run() == TRUE) {
$data = array(
'title' => $this->input->post('title'),
'contents' => $this->input->post('content')
);
 
$this->site_model->add_record($data);
}
$this->index();
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.