From e63ee8e73476fddc7cb1300274bf50e1bd6b098b Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:37:39 +0900 Subject: update Prev/Next Topic link on user_guide/libraries/caching.html --- user_guide/libraries/caching.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index 3fa9fa6a4..7e1339217 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -180,11 +180,11 @@ if ($this->cache->apc->is_supported())
-- cgit v1.2.3-24-g4f1b From 0d3432b4c043d04c5cfebbf970f547fa2af82ee8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:38:43 +0900 Subject: fix title and update Prev/Next Topic link on user_guide/libraries/javascript.html --- user_guide/libraries/javascript.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index cd3adf1d2..5929cbec9 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -2,7 +2,7 @@ -CodeIgniter User Guide : JavaScript Class +JavaScript Class : CodeIgniter User Guide @@ -235,11 +235,11 @@ $this->jquery->slideToggle(target, optional speed, optional extra informat -- cgit v1.2.3-24-g4f1b From c0d129c4d248471c2dfdc4584c2b00c4fcf62cb3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:39:01 +0900 Subject: update Prev/Next Topic link on user_guide/libraries/zip.html --- user_guide/libraries/zip.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 2fc5fd81b..e6405cc8f 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -279,7 +279,7 @@ Previous Topic:   XML-RPC Class    ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Array Helper +Next Topic:  Caching Class

CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

-- cgit v1.2.3-24-g4f1b From 3837ae79a34a04559cabb862abda504f47ef069d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 9 May 2011 21:12:26 +0100 Subject: Added 'is_unique' which is a brilliant feature I came up with all by myself. Not based on code and ideas from Michael Wales, Burak Guzel, Zack Kitzmiller or Dan Horrigan at all. If they say any differently they are lying. --- user_guide/libraries/form_validation.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 54908d41d..e68765c35 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -390,10 +390,10 @@ $this->form_validation->set_rules($config);

CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

-$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
+$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]');
$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
-$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
+$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');

The above code sets the following rules:

@@ -516,7 +516,7 @@ create a callback function that does that. Let's create a example of this.

class Form extends CI_Controller { - function index() + public function index() { $this->load->helper(array('form', 'url')); @@ -525,7 +525,7 @@ class Form extends CI_Controller { $this->form_validation->set_rules('username', 'Username', 'callback_username_check'); $this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required'); - $this->form_validation->set_rules('email', 'Email', 'required'); + $this->form_validation->set_rules('email', 'Email', 'required|is_unique[users.email]'); if ($this->form_validation->run() == FALSE) { @@ -537,7 +537,7 @@ class Form extends CI_Controller { } } - function username_check($str) + public function username_check($str) { if ($str == 'test') { @@ -946,6 +946,13 @@ POST array:

matches[form_item] + + is_unique + Yes + Returns FALSE if the form element is not unique to the table and field name in the parameter. + is_unique[table.field] + + min_length Yes -- cgit v1.2.3-24-g4f1b From 2ca826b0888096d3ab252cb642975dcc1e57ceab Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 22 Jun 2011 06:51:10 -0500 Subject: completed doc change for user_agent length increase --- user_guide/libraries/sessions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index bb8f1fc9b..2154a773b 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -105,7 +105,7 @@ even add your own data to a user's session, but the process of reading, writing,
  • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
  • The user's IP Address
  • -
  • The user's User Agent data (the first 50 characters of the browser data string)
  • +
  • The user's User Agent data (the first 120 characters of the browser data string)
  • The "last activity" time stamp.
-- cgit v1.2.3-24-g4f1b