--
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:
@@ -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)