Skip to content

Commit 4152f15

Browse files
committed
docs: fix title underlines
1 parent 2732abb commit 4152f15

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _validation:
22

33
Validation
4-
##################################################
4+
##########
55

66
CodeIgniter provides a comprehensive data validation class that
77
helps minimize the amount of code you'll write.
@@ -11,7 +11,7 @@ helps minimize the amount of code you'll write.
1111
:depth: 2
1212

1313
Overview
14-
************************************************
14+
********
1515

1616
Before explaining CodeIgniter's approach to data validation, let's
1717
describe the ideal scenario:
@@ -43,7 +43,7 @@ HTML. Form validation, while simple to create, is generally very messy
4343
and tedious to implement.
4444

4545
Form Validation Tutorial
46-
************************************************
46+
************************
4747

4848
What follows is a "hands on" tutorial for implementing CodeIgniter's Form
4949
Validation.
@@ -60,7 +60,7 @@ Let's create those three things, using a member sign-up form as the
6060
example.
6161

6262
The Form
63-
================================================
63+
========
6464

6565
Using a text editor, create a form called **Signup.php**. In it, place this
6666
code and save it to your **app/Views/** folder::
@@ -95,7 +95,7 @@ code and save it to your **app/Views/** folder::
9595
</html>
9696

9797
The Success Page
98-
================================================
98+
================
9999

100100
Using a text editor, create a form called **Success.php**. In it, place
101101
this code and save it to your **app/Views/** folder::
@@ -114,15 +114,15 @@ this code and save it to your **app/Views/** folder::
114114
</html>
115115

116116
The Controller
117-
================================================
117+
==============
118118

119119
Using a text editor, create a controller called **Form.php**. In it, place
120120
this code and save it to your **app/Controllers/** folder:
121121

122122
.. literalinclude:: validation/001.php
123123

124124
Try it!
125-
================================================
125+
=======
126126

127127
To try your form, visit your site using a URL similar to this one::
128128

@@ -140,7 +140,7 @@ the **Validation class** inside. See :ref:`controllers-validating-data`.
140140
any of them failing.
141141

142142
Explanation
143-
================================================
143+
===========
144144

145145
You'll notice several things about the above pages:
146146

@@ -166,7 +166,7 @@ Based on whether the validation was successful it either presents the
166166
form or the success page.
167167

168168
Add Validation Rules
169-
================================================
169+
====================
170170

171171
Then add validation rules in the controller (**Form.php**):
172172

@@ -206,7 +206,7 @@ If you want to use these rules, you need to change the rule classes in **app/Con
206206
.. literalinclude:: validation/003.php
207207

208208
Loading the Library
209-
************************************************
209+
*******************
210210

211211
The library is loaded as a service named **validation**:
212212

@@ -219,7 +219,7 @@ for including multiple Rulesets, and collections of rules that can be easily reu
219219
the :doc:`Model </models/model>` provide methods to make validation even easier.
220220

221221
Setting Validation Rules
222-
************************************************
222+
************************
223223

224224
CodeIgniter lets you set as many validation rules as you need for a
225225
given field, cascading them in order. To set validation rules you
@@ -268,10 +268,10 @@ data to be validated:
268268
.. literalinclude:: validation/008.php
269269

270270
Working with Validation
271-
************************************************
271+
***********************
272272

273273
Validating Keys that are Arrays
274-
================================================
274+
===============================
275275

276276
If your data is in a nested associative array, you can use "dot array syntax" to
277277
easily validate your data:
@@ -288,14 +288,14 @@ For example, data returned by multi select dropdown:
288288
.. literalinclude:: validation/011.php
289289

290290
Validate 1 Value
291-
================================================
291+
================
292292

293293
Validate one value against a rule:
294294

295295
.. literalinclude:: validation/012.php
296296

297297
Saving Sets of Validation Rules to the Config File
298-
=======================================================
298+
==================================================
299299

300300
A nice feature of the Validation class is that it permits you to store all
301301
your validation rules for your entire application in a config file. You organize
@@ -305,7 +305,7 @@ the validation.
305305
.. _validation-array:
306306

307307
How to save your rules
308-
-------------------------------------------------------
308+
----------------------
309309

310310
To store your validation rules, simply create a new public property in the ``Config\Validation``
311311
class with the name of your group. This element will hold an array with your validation
@@ -330,7 +330,7 @@ Or pass all settings in an array:
330330
See below for details on the formatting of the array.
331331

332332
Getting & Setting Rule Groups
333-
-------------------------------------------------------
333+
-----------------------------
334334

335335
**Get Rule Group**
336336

@@ -345,7 +345,7 @@ This method sets a rule group from the validation configuration to the validatio
345345
.. literalinclude:: validation/018.php
346346

347347
Running Multiple Validations
348-
=======================================================
348+
============================
349349

350350
.. note:: ``run()`` method will not reset error state. Should a previous run fail,
351351
``run()`` will always return false and ``getErrors()`` will return
@@ -359,7 +359,7 @@ you previously set, so ``setRules()``, ``setRuleGroup()`` etc. need to be repeat
359359
.. literalinclude:: validation/019.php
360360

361361
Validation Placeholders
362-
=======================================================
362+
=======================
363363

364364
The Validation class provides a simple method to replace parts of your rules based on data that's being passed into it. This
365365
sounds fairly obscure but can be especially handy with the ``is_unique`` validation rule. Placeholders are simply
@@ -383,7 +383,7 @@ This can also be used to create more dynamic rules at runtime, as long as you ta
383383
keys passed in don't conflict with your form data.
384384

385385
Working With Errors
386-
************************************************
386+
*******************
387387

388388
The Validation library provides several methods to help you set error messages, provide
389389
custom error messages, and retrieve one or more errors to display.
@@ -535,7 +535,7 @@ right after the name of the field the error should belong to::
535535
<?= $validation->showError('username', 'my_single') ?>
536536

537537
Creating Custom Rules
538-
************************************************
538+
*********************
539539

540540
Rules are stored within simple, namespaced classes. They can be stored any location you would like, as long as the
541541
autoloader can find it. These files are called RuleSets. To add a new RuleSet, edit **Config/Validation.php** and

0 commit comments

Comments
 (0)