diff options
author | Joël Cox <joel@joelcox.nl> | 2011-08-27 20:21:19 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-10-27 00:44:14 +0200 |
commit | 7bd6335c77cfc5fec9e7e788d45d110c1b09ffd1 (patch) | |
tree | c4bbf6c2f08df78fb0b1be5ad8f9aa58f1915b7e /user_guide/tutorial/create_news_items.html | |
parent | 5cbced2f3899726241b7a3a83e47a92fb01dbf83 (diff) |
Renamed introduction to index and small code style fixes (patch by @ericbarnes).
Diffstat (limited to 'user_guide/tutorial/create_news_items.html')
-rw-r--r-- | user_guide/tutorial/create_news_items.html | 8 |
1 files changed, 3 insertions, 5 deletions
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 @@ <td id="breadcrumb"> <a href="http://codeigniter.com/">CodeIgniter Home</a> › <a href="../index.html">User Guide Home</a> › -<a href="introduction.html">Tutorial</a> › +<a href="index.html">Tutorial</a> › Create news items </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td> @@ -90,7 +90,7 @@ Create news items <p>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 <a href="../libraries/form_validation.html">form validation</a> library to do this.</p> <pre> -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'); } - } </pre> @@ -127,7 +126,7 @@ function create() <p>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:</p> <pre> -function set_news() +public function set_news() { $this->load->helper('url'); @@ -140,7 +139,6 @@ function set_news() ); return $this->db->insert('news', $data); - } </pre> |