Skip to content

Commit 699fc2f

Browse files
authored
docs: convert the remaining user guide tables to pipe-table-friendly RST (#10664)
* docs: convert the remaining user guide tables to pipe-table-friendly RST * docs: fix rendering for `mb_*`
1 parent 345262a commit 699fc2f

6 files changed

Lines changed: 89 additions & 85 deletions

File tree

‎user_guide_src/source/changelogs/v4.0.0-alpha.3.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ PRs merged
261261
- #1540 Update validation class User Guide
262262
- #1530 database performance improvement : use foreach() when possible
263263
- 2047b5a Don't run filters when using spark.
264-
- #1539 remove mb_* (mb string usage) in CreditCardRules
264+
- #1539 remove mb\_* (mb string usage) in CreditCardRules
265265
- #1536 ext-json in composer.json
266266
- #1525 remove unneeded try {} catch {}
267267
- #1524 Test routes resource with 'websafe' option

‎user_guide_src/source/database/configuration.rst‎

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ Description of Values
148148
**username** The username used to connect to the database. (``SQLite3`` does not use this.)
149149
**password** The password used to connect to the database. (``SQLite3`` does not use this.)
150150
**database** The name of the database you want to connect to.
151-
152-
.. note:: CodeIgniter doesn't support dots (``.``) in the table and column names.
153-
Since v4.5.0, database names with dots are supported.
154151
**DBDriver** The database driver name. The case must match the driver name.
155152
You can set a fully qualified classname to use your custom driver.
156153
Supported drivers: ``MySQLi``, ``Postgre``, ``SQLite3``, ``SQLSRV``, and ``OCI8``.
@@ -173,28 +170,35 @@ Description of Values
173170
strict SQL while developing an application.
174171
**port** The database port number - Empty string ``''`` for default port (or dynamic port with ``SQLSRV``).
175172
**foreignKeys** (``SQLite3`` only) true/false (boolean) - Whether to enable Foreign Key constraint.
176-
177-
.. important:: SQLite3 Foreign Key constraint is disabled by default.
178-
See `SQLite documentation <https://www.sqlite.org/pragma.html#pragma_foreign_keys>`_.
179-
To enforce Foreign Key constraint, set this config item to true.
180173
**busyTimeout** (``SQLite3`` only) milliseconds (int) - Sleeps for a specified amount of time when a table is locked.
181174
**synchronous** (``SQLite3`` only) flag (int) - How strict SQLite will be at flushing to disk during transactions.
182175
Use `null` to stay with the default setting. This can be used since v4.6.0.
183176
**numberNative** (``MySQLi`` only) true/false (boolean) - Whether to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE.
184177
**foundRows** (``MySQLi`` only) true/false (boolean) - Whether to enable MYSQLI_CLIENT_FOUND_ROWS.
185-
**dateFormat** The default date/time formats as PHP's `DateTime format`_.
186-
* ``date`` - date format
187-
* ``datetime`` - date and time format
188-
* ``datetime-ms`` - date and time with millisecond format
189-
* ``datetime-us`` - date and time with microsecond format
190-
* ``time`` - time format
191-
This can be used since v4.5.0, and you can get the value, e.g., ``$db->dateFormat['datetime']``.
192-
Currently, the database drivers do not use these values directly,
193-
but :ref:`Model <model-saving-dates>` uses them.
178+
**dateFormat** The default date/time formats as PHP's `DateTime format`_, with the keys listed below the table.
194179
================ ===========================================================================================================
195180

196181
.. _DateTime format: https://www.php.net/manual/en/datetime.format.php
197182

183+
.. note:: CodeIgniter doesn't support dots (``.``) in the table and column names.
184+
Since v4.5.0, database names with dots are supported.
185+
186+
.. important:: SQLite3 Foreign Key constraint is disabled by default.
187+
See `SQLite documentation <https://www.sqlite.org/pragma.html#pragma_foreign_keys>`_.
188+
To enforce Foreign Key constraint, set **foreignKeys** to true.
189+
190+
The **dateFormat** array has the following keys:
191+
192+
* ``date`` - date format
193+
* ``datetime`` - date and time format
194+
* ``datetime-ms`` - date and time with millisecond format
195+
* ``datetime-us`` - date and time with microsecond format
196+
* ``time`` - time format
197+
198+
This can be used since v4.5.0, and you can get the value, e.g., ``$db->dateFormat['datetime']``.
199+
Currently, the database drivers do not use these values directly,
200+
but :ref:`Model <model-saving-dates>` uses them.
201+
198202
.. note:: Depending on what database driver you are using (``MySQLi``, ``Postgre``,
199203
etc.) not all values will be needed. For example, when using ``SQLite3`` you
200204
will not need to supply a username or password, and the database name

‎user_guide_src/source/installation/upgrade_migrations.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Search & Replace
7070
You can use to following table to search & replace your old CI3 files.
7171

7272
+------------------------------+----------------------------+
73-
| Search | Replace |
73+
| Search | Replace |
7474
+==============================+============================+
7575
| extends CI_Migration | extends Migration |
7676
+------------------------------+----------------------------+

‎user_guide_src/source/libraries/validation.rst‎

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,41 +1082,41 @@ See also :ref:`file-upload-form-tutorial`.
10821082
======================= ========== ============================================= ===================================================
10831083
Rule Parameter Description Example
10841084
======================= ========== ============================================= ===================================================
1085-
uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]``
1086-
match the name of any uploaded files.
1087-
If you want the file upload to be optional
1088-
(not required), do not define this rule.
1089-
1090-
max_size Yes Fails if the uploaded file is larger ``max_size[field_name,2048]``
1091-
than the second parameter
1092-
in kilobytes (kb). Or if the file
1093-
is larger than allowed maximum size declared
1094-
in php.ini config file -
1095-
``upload_max_filesize`` directive.
1096-
max_dims Yes Fails if the maximum width and height of an ``max_dims[field_name,300,150]``
1097-
uploaded image exceed values. The first
1098-
parameter is the field name. The second is
1099-
the width, and the third is the height. Will
1100-
also fail if the file cannot be determined
1101-
to be an image or the upload failed with an
1102-
error other than ``UPLOAD_ERR_NO_FILE``.
1103-
min_dims Yes Fails if the minimum width and height of an ``min_dims[field_name,300,150]``
1104-
uploaded image not meet values. The first
1105-
parameter is the field name. The second is
1106-
the width, and the third is the height. Will
1107-
also fail if the file cannot be determined
1108-
to be an image or the upload failed with an
1109-
error other than ``UPLOAD_ERR_NO_FILE``.
1110-
(This rule was added in
1111-
v4.6.0.)
1112-
mime_in Yes Fails if the file's mime type is not one ``mime_in[field_name,image/png,image/jpeg]``
1113-
listed in the parameters.
1114-
ext_in Yes Fails if the client filename's extension is ``ext_in[field_name,png,jpg,gif]``
1115-
not one listed in the parameters, or if the
1116-
detected MIME type does not match the MIME
1117-
types associated with the extension.
1118-
is_image Yes Fails if the file cannot be determined to be ``is_image[field_name]``
1119-
an image based on the mime type.
1085+
uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]``
1086+
match the name of any uploaded files.
1087+
If you want the file upload to be optional
1088+
(not required), do not define this rule.
1089+
1090+
max_size Yes Fails if the uploaded file is larger ``max_size[field_name,2048]``
1091+
than the second parameter
1092+
in kilobytes (kb). Or if the file
1093+
is larger than allowed maximum size declared
1094+
in php.ini config file -
1095+
``upload_max_filesize`` directive.
1096+
max_dims Yes Fails if the maximum width and height of an ``max_dims[field_name,300,150]``
1097+
uploaded image exceed values. The first
1098+
parameter is the field name. The second is
1099+
the width, and the third is the height. Will
1100+
also fail if the file cannot be determined
1101+
to be an image or the upload failed with an
1102+
error other than ``UPLOAD_ERR_NO_FILE``.
1103+
min_dims Yes Fails if the minimum width and height of an ``min_dims[field_name,300,150]``
1104+
uploaded image not meet values. The first
1105+
parameter is the field name. The second is
1106+
the width, and the third is the height. Will
1107+
also fail if the file cannot be determined
1108+
to be an image or the upload failed with an
1109+
error other than ``UPLOAD_ERR_NO_FILE``.
1110+
(This rule was added in
1111+
v4.6.0.)
1112+
mime_in Yes Fails if the file's mime type is not one ``mime_in[field_name,image/png,image/jpeg]``
1113+
listed in the parameters.
1114+
ext_in Yes Fails if the client filename's extension is ``ext_in[field_name,png,jpg,gif]``
1115+
not one listed in the parameters, or if the
1116+
detected MIME type does not match the MIME
1117+
types associated with the extension.
1118+
is_image Yes Fails if the file cannot be determined to be ``is_image[field_name]``
1119+
an image based on the mime type.
11201120
======================= ========== ============================================= ===================================================
11211121

11221122
The file validation rules apply for both single and multiple file uploads.

‎user_guide_src/source/models/model.rst‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,9 @@ afterUpdate **id** = the array of primary keys of the rows being passed to
10391039
**data** = the key/value pairs being updated.
10401040
**result** = the results of the ``update()`` method used through the Query Builder.
10411041
beforeFind The name of the calling **method**, whether a **singleton** was requested, and these additional fields:
1042-
- ``first()`` No additional fields
1043-
- ``find()`` **id** = the primary key of the row being searched for.
1044-
- ``findAll()`` **limit** = the number of rows to find.
1045-
**offset** = the number of rows to skip during the search.
1042+
none for ``first()``, **id** = the primary key of the row being searched for, for ``find()``,
1043+
and **limit** = the number of rows to find, and **offset** = the number of rows to skip during
1044+
the search, for ``findAll()``.
10461045
afterFind Same as **beforeFind** but including the resulting row(s) of data, or null if no result found.
10471046
beforeDelete **id** = an array of primary key rows being passed to the ``delete()`` method.
10481047
**purge** = boolean whether soft-delete rows should be hard deleted.

‎user_guide_src/source/outgoing/view_parser.rst‎

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -438,63 +438,64 @@ Provided Filters
438438
The following filters are available when using the parser:
439439

440440
================ ================= =========================================================== ======================================
441-
Filter Arguments Description Example
441+
Filter Arguments Description Example
442442
================ ================= =========================================================== ======================================
443-
abs Displays the absolute value of a number. { v|abs }
443+
abs Displays the absolute value of a number. ``{ v|abs }``
444444

445-
capitalize Displays the string in sentence case: all lowercase { v|capitalize}
445+
capitalize Displays the string in sentence case: all lowercase ``{ v|capitalize}``
446446
with firstletter capitalized.
447447

448-
date format (Y-m-d) A PHP **date**-compatible formatting string. { v|date(Y-m-d) }
448+
date format (Y-m-d) A PHP **date**-compatible formatting string. ``{ v|date(Y-m-d) }``
449449

450-
date_modify value to add A **strtotime** compatible string to modify the date, { v|date_modify(+1 day) }
451-
/ subtract like ``+5 day`` or ``-1 week``.
450+
date_modify value to add A **strtotime** compatible string to modify the date, ``{ v|date_modify(+1 day) }``
451+
/ subtract like ``+5 day`` or ``-1 week``.
452452

453-
default default value Displays the default value if the variable is `empty()`_. { v|default(just in case) }
453+
default default value Displays the default value if the variable is `empty()`_. ``{ v|default(just in case) }``
454454

455-
esc html, attr, Specifies the context to escape the data. { v|esc(attr) }
456-
css, js
455+
esc html, attr, Specifies the context to escape the data. ``{ v|esc(attr) }``
456+
css, js
457457

458-
excerpt phrase, radius Returns the text within a radius of words from a given { v|excerpt(green giant, 20) }
458+
excerpt phrase, radius Returns the text within a radius of words from a given ``{ v|excerpt(green giant, 20) }``
459459
phrase. Same as **excerpt** helper function.
460460

461-
highlight phrase Highlights a given phrase within the text using { v|highlight(view parser) }
462-
'<mark></mark>' tags.
461+
highlight phrase Highlights a given phrase within the text using ``{ v|highlight(view parser) }``
462+
``<mark></mark>`` tags.
463463

464-
highlight_code Highlights code samples with HTML/CSS. { v|highlight_code }
464+
highlight_code Highlights code samples with HTML/CSS. ``{ v|highlight_code }``
465465

466-
limit_chars limit Limits the number of characters to $limit. { v|limit_chars(100) }
466+
limit_chars limit Limits the number of characters to $limit. ``{ v|limit_chars(100) }``
467467

468-
limit_words limit Limits the number of words to $limit. { v|limit_words(20) }
468+
limit_words limit Limits the number of words to $limit. ``{ v|limit_words(20) }``
469469

470-
local_currency currency, Displays a localized version of a currency. "currency" { v|local_currency(EUR,en_US) }
471-
locale, valueis any 3-letter ISO 4217 currency code.
472-
fraction
470+
local_currency currency, Displays a localized version of a currency. "currency" ``{ v|local_currency(EUR,en_US) }``
471+
locale, valueis any 3-letter ISO 4217 currency code.
472+
fraction
473473

474-
local_number type, precision, Displays a localized version of a number. "type" can be { v|local_number(decimal,2,en_US) }
475-
locale one of: decimal, currency, percent, scientific, spellout,
474+
local_number type, precision, Displays a localized version of a number. "type" can be ``{ v|local_number(decimal,2,en_US) }``
475+
locale one of: decimal, currency, percent, scientific, spellout,
476476
ordinal, duration.
477477

478-
lower Converts a string to lowercase. { v|lower }
478+
lower Converts a string to lowercase. ``{ v|lower }``
479479

480-
nl2br Replaces all newline characters (\n) to an HTML <br/> tag. { v|nl2br }
480+
nl2br Replaces all newline characters (``\n``) to an HTML ``{ v|nl2br }``
481+
``<br/>`` tag.
481482

482-
number_format places Wraps PHP **number_format** function for use within the { v|number_format(3) }
483+
number_format places Wraps PHP **number_format** function for use within the ``{ v|number_format(3) }``
483484
parser.
484485

485-
prose Takes a body of text and uses the **auto_typography()** { v|prose }
486+
prose Takes a body of text and uses the **auto_typography()** ``{ v|prose }``
486487
method to turn it into prettier, easier-to-read, prose.
487488

488-
round places, type Rounds a number to the specified places. Types of **ceil** { v|round(3) } { v|round(ceil) }
489+
round places, type Rounds a number to the specified places. Types of **ceil** ``{ v|round(3) }`` ``{ v|round(ceil) }``
489490
and **floor** can be passed to use those functions instead.
490491

491-
strip_tags allowed chars Wraps PHP **strip_tags**. Can accept a string of allowed { v|strip_tags(<br>) }
492+
strip_tags allowed chars Wraps PHP **strip_tags**. Can accept a string of allowed ``{ v|strip_tags(<br>) }``
492493
tags.
493494

494-
title Displays a "title case" version of the string, with all { v|title }
495+
title Displays a "title case" version of the string, with all ``{ v|title }``
495496
lowercase, and each word capitalized.
496497

497-
upper Displays the string in all uppercase. { v|upper }
498+
upper Displays the string in all uppercase. ``{ v|upper }``
498499
================ ================= =========================================================== ======================================
499500

500501
.. _empty(): https://www.php.net/manual/en/function.empty.php

0 commit comments

Comments
 (0)