summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-11-10 22:42:05 +0100
committerGreg Aker <greg.aker@ellislab.com>2010-11-10 22:42:05 +0100
commitc7820fe44d425edb9e223cc12b62ec65c2f28e23 (patch)
treec52d31e06c4cb87da7e13b3405b5836ae2219d07
parent1f2b3f06d951d949f5b565f0955e3e68d32008e2 (diff)
parent9f9af60e2d852177403a941ad876718161ba1375 (diff)
Merging in changes
-rw-r--r--system/libraries/Form_validation.php12
-rw-r--r--user_guide/changelog.html1
2 files changed, 10 insertions, 3 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index d62071b79..bf3689058 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -77,7 +77,7 @@ class CI_Form_validation {
// No reason to set rules if we have no POST data
if (count($_POST) == 0)
{
- return;
+ return $this;
}
// If an array was passed via the first parameter instead of indidual string
@@ -98,13 +98,13 @@ class CI_Form_validation {
// Here we go!
$this->set_rules($row['field'], $label, $row['rules']);
}
- return;
+ return $this;
}
// No fields? Nothing to do...
if ( ! is_string($field) OR ! is_string($rules) OR $field == '')
{
- return;
+ return $this;
}
// If the field label wasn't passed we use the field name
@@ -146,6 +146,8 @@ class CI_Form_validation {
'postdata' => NULL,
'error' => ''
);
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -169,6 +171,8 @@ class CI_Form_validation {
}
$this->_error_messages = array_merge($this->_error_messages, $lang);
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -187,6 +191,8 @@ class CI_Form_validation {
{
$this->_error_prefix = $prefix;
$this->_error_suffix = $suffix;
+
+ return $this;
}
// --------------------------------------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 181fbe4db..9cce79b4c 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -106,6 +106,7 @@ Hg Tag: </p>
<li>Changed the default encryption mode in the Encryption library to CBC.</li>
<li>Added an <kbd>encode_from_legacy()</kbd> method to provide a way to transition encrypted data from CodeIgniter 1.x to CodeIgniter 2.x.
Please see the <a href="./installation/upgrade_200.html">upgrade instructions</a> for details.</li>
+ <li>Altered Form_Validation library to allow for method chaining on <kbd>set_rules()</kbd>, <kbd>set_message()</kbd> and <kbd>set_error_delimiters()</kbd> functions.</li>
</ul>
</li>
<li>Database