Skip to content

Instantly share code, notes, and snippets.

@uokesita
Created January 15, 2011 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uokesita/780711 to your computer and use it in GitHub Desktop.
Save uokesita/780711 to your computer and use it in GitHub Desktop.
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