From 7bd6335c77cfc5fec9e7e788d45d110c1b09ffd1 Mon Sep 17 00:00:00 2001 From: Joël Cox Date: Sat, 27 Aug 2011 20:21:19 +0200 Subject: Renamed introduction to index and small code style fixes (patch by @ericbarnes). --- user_guide/tutorial/create_news_items.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'user_guide/tutorial/create_news_items.html') diff --git a/user_guide/tutorial/create_news_items.html b/user_guide/tutorial/create_news_items.html index a25917930..48c82c799 100644 --- a/user_guide/tutorial/create_news_items.html +++ b/user_guide/tutorial/create_news_items.html @@ -42,7 +42,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Tutorial  ›  +Tutorial  ›  Create news items
Search User Guide   
@@ -90,7 +90,7 @@ Create news items

Go back to your news controller. You're going to do two things here, check whether the form was submitted and whether the submitted data passed the validation rules. You'll use the form validation library to do this.

-function create()
+public function create()
 {
 	$this->load->helper('form');
 	$this->load->library('form_validation');
@@ -112,7 +112,6 @@ function create()
 		$this->news_model->set_news();
 		$this->load->view('news/success');
 	}
-	
 }
 
@@ -127,7 +126,7 @@ function create()

The only thing that remains is writing a method that writes the data to the database. You'll use the Active Record class to insert the information and use the input library to get the posted data. Open up the model created earlier and add the following:

-function set_news()
+public function set_news()
 {
 	$this->load->helper('url');
 	
@@ -140,7 +139,6 @@ function set_news()
 	);
 	
 	return $this->db->insert('news', $data);
-	
 }
 
-- cgit v1.2.3-24-g4f1b