Create a gist now

Instantly share code, notes, and snippets.

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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment